| 1 | // eslint-disable-next-line n/no-unpublished-require |
| 2 | const { defineConfig } = require('eslint-define-config') |
| 3 | |
| 4 | module.exports = defineConfig({ |
| 5 | root: true, |
| 6 | env: { |
| 7 | es2022: true, |
| 8 | node: true |
| 9 | }, |
| 10 | parserOptions: { |
| 11 | sourceType: 'module', |
| 12 | ecmaVersion: 2022 |
| 13 | }, |
| 14 | plugins: ['simple-import-sort'], |
| 15 | extends: ['eslint:recommended', 'plugin:import/recommended'], |
| 16 | settings: { |
| 17 | 'import/resolver': { |
| 18 | typescript: { |
| 19 | project: './tsconfig.json' |
| 20 | } |
| 21 | } |
| 22 | }, |
| 23 | rules: { |
| 24 | 'simple-import-sort/imports': 'error', |
| 25 | 'simple-import-sort/exports': 'error' |
| 26 | }, |
| 27 | overrides: [ |
| 28 | { |
| 29 | files: ['**/*.ts'], |
| 30 | parser: '@typescript-eslint/parser', |
| 31 | parserOptions: { |
| 32 | project: './tsconfig.json' |
| 33 | }, |
| 34 | plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], |
| 35 | extends: [ |
| 36 | 'plugin:@typescript-eslint/strict-type-checked', |
| 37 | 'plugin:@typescript-eslint/stylistic-type-checked', |
| 38 | 'plugin:import/typescript', |
| 39 | 'love' |
| 40 | ], |
| 41 | rules: { |
| 42 | 'operator-linebreak': 'off', |
| 43 | 'tsdoc/syntax': 'warn' |
| 44 | } |
| 45 | }, |
| 46 | { |
| 47 | files: ['**/*.js', '**/*.cjs', '**/*.mjs'], |
| 48 | plugins: ['jsdoc'], |
| 49 | extends: ['plugin:n/recommended', 'plugin:jsdoc/recommended', 'standard'], |
| 50 | rules: { |
| 51 | 'n/shebang': 'off' |
| 52 | } |
| 53 | } |
| 54 | ] |
| 55 | }) |