|
| 1 | +import { join } from 'node:path'; |
| 2 | +import { includeIgnoreFile } from '@eslint/compat'; |
| 3 | +import eslintPluginJs from '@eslint/js'; |
| 4 | +import importPlugin from 'eslint-plugin-import'; |
| 5 | +import jestPlugin from 'eslint-plugin-jest'; |
| 6 | +import jsdocPlugin from 'eslint-plugin-jsdoc'; |
| 7 | +import nodePlugin from 'eslint-plugin-n'; |
| 8 | +import prettierPlugin from 'eslint-plugin-prettier/recommended'; // per docs prettier/recommended includes eslint-config-prettier |
| 9 | + |
| 10 | +export default [ |
| 11 | + includeIgnoreFile(join(process.cwd(), '.gitignore')), |
| 12 | + jestPlugin.configs['flat/recommended'], |
| 13 | + jsdocPlugin.configs['flat/recommended'], |
| 14 | + nodePlugin.configs['flat/recommended'], |
| 15 | + importPlugin.flatConfigs.recommended, |
| 16 | + eslintPluginJs.configs.recommended, |
| 17 | + prettierPlugin, |
| 18 | + { |
| 19 | + ignores: ['src/__fixtures__/**/*'], |
| 20 | + languageOptions: { |
| 21 | + globals: { |
| 22 | + cleanConfigurationPaths: 'readonly', |
| 23 | + fixturePath: 'readonly', |
| 24 | + generateFixture: 'readonly', |
| 25 | + mockObjectProperty: 'readonly', |
| 26 | + removeFixture: 'readonly', |
| 27 | + setMockResourceFunctions: 'readonly', |
| 28 | + tempFixturePath: 'readonly' |
| 29 | + }, |
| 30 | + ecmaVersion: 2022 |
| 31 | + }, |
| 32 | + rules: { |
| 33 | + 'arrow-parens': ['error', 'as-needed'], |
| 34 | + 'comma-dangle': 0, |
| 35 | + 'consistent-return': 1, |
| 36 | + 'jsdoc/no-undefined-types': 2, |
| 37 | + 'jsdoc/no-defaults': 0, |
| 38 | + 'jsdoc/require-jsdoc': 2, |
| 39 | + 'jsdoc/require-param': 2, |
| 40 | + 'jsdoc/require-param-description': 0, |
| 41 | + 'jsdoc/require-param-name': 2, |
| 42 | + 'jsdoc/require-param-type': 2, |
| 43 | + 'jsdoc/require-property': 2, |
| 44 | + 'jsdoc/require-property-description': 0, |
| 45 | + 'jsdoc/require-property-name': 2, |
| 46 | + 'jsdoc/require-property-type': 2, |
| 47 | + 'jsdoc/require-returns': 2, |
| 48 | + 'jsdoc/require-returns-description': 0, |
| 49 | + 'jsdoc/require-returns-type': 2, |
| 50 | + 'jsdoc/tag-lines': [ |
| 51 | + 'warn', |
| 52 | + 'always', |
| 53 | + { |
| 54 | + count: 0, |
| 55 | + applyToEndTag: false, |
| 56 | + startLines: 1 |
| 57 | + } |
| 58 | + ], |
| 59 | + 'max-len': [ |
| 60 | + 'error', |
| 61 | + { |
| 62 | + code: 240, |
| 63 | + ignoreUrls: true |
| 64 | + } |
| 65 | + ], |
| 66 | + 'n/no-unsupported-features/es-syntax': 1, |
| 67 | + 'n/shebang': 0, |
| 68 | + 'n/no-unpublished-bin': 0, |
| 69 | + 'no-console': 0, |
| 70 | + 'no-debugger': 1, |
| 71 | + 'no-plusplus': 0, |
| 72 | + 'no-unused-vars': [ |
| 73 | + 'error', |
| 74 | + { |
| 75 | + caughtErrors: 'none' |
| 76 | + } |
| 77 | + ], |
| 78 | + 'no-unsafe-optional-chaining': 1, |
| 79 | + 'no-var': 2, |
| 80 | + 'padded-blocks': 0, |
| 81 | + 'prettier/prettier': [ |
| 82 | + 'error', |
| 83 | + { |
| 84 | + arrowParens: 'avoid', |
| 85 | + singleQuote: true, |
| 86 | + trailingComma: 'none', |
| 87 | + printWidth: 120 |
| 88 | + } |
| 89 | + ] |
| 90 | + } |
| 91 | + } |
| 92 | +]; |
0 commit comments