| | import js from '@eslint/js' |
| | import tseslint from '@typescript-eslint/eslint-plugin' |
| | import tsParser from '@typescript-eslint/parser' |
| | import github from 'eslint-plugin-github' |
| | import importPlugin from 'eslint-plugin-import' |
| | import jsxA11y from 'eslint-plugin-jsx-a11y' |
| | import primerReact from 'eslint-plugin-primer-react' |
| | import eslintComments from 'eslint-plugin-eslint-comments' |
| | import i18nText from 'eslint-plugin-i18n-text' |
| | import filenames from 'eslint-plugin-filenames' |
| | import noOnlyTests from 'eslint-plugin-no-only-tests' |
| | import prettierPlugin from 'eslint-plugin-prettier' |
| | import prettier from 'eslint-config-prettier' |
| | import globals from 'globals' |
| |
|
| | export default [ |
| | { |
| | files: ['**/*.{ts,tsx}'], |
| | languageOptions: { |
| | parser: tsParser, |
| | ecmaVersion: 2022, |
| | sourceType: 'module', |
| | globals: { |
| | ...globals.browser, |
| | ...globals.node, |
| | ...globals.commonjs, |
| | ...globals.es2020, |
| | |
| | RequestInit: 'readonly', |
| | RequestInfo: 'readonly', |
| | HeadersInit: 'readonly', |
| | JSX: 'readonly', |
| | |
| | BufferEncoding: 'readonly', |
| | NodeJS: 'readonly', |
| | |
| | cheerio: 'readonly', |
| | }, |
| | parserOptions: { |
| | requireConfigFile: false, |
| | }, |
| | }, |
| | settings: { |
| | 'import/resolver': { |
| | typescript: true, |
| | node: true, |
| | }, |
| | }, |
| | plugins: { |
| | github, |
| | import: importPlugin, |
| | 'eslint-comments': eslintComments, |
| | 'i18n-text': i18nText, |
| | filenames, |
| | 'no-only-tests': noOnlyTests, |
| | prettier: prettierPlugin, |
| | '@typescript-eslint': tseslint, |
| | 'primer-react': primerReact, |
| | 'jsx-a11y': jsxA11y, |
| | }, |
| | rules: { |
| | |
| | ...js.configs.recommended.rules, |
| |
|
| | |
| | ...github.configs.recommended.rules, |
| |
|
| | |
| | ...importPlugin.configs.errors.rules, |
| |
|
| | |
| | ...tseslint.configs.recommended.rules, |
| |
|
| | |
| | ...primerReact.configs.recommended.rules, |
| |
|
| | |
| | ...jsxA11y.configs.recommended.rules, |
| |
|
| | |
| | 'import/no-extraneous-dependencies': [ |
| | 'error', |
| | { |
| | packageDir: '.', |
| | }, |
| | ], |
| | 'import/extensions': ['error', { json: 'always' }], |
| | 'no-empty': ['error', { allowEmptyCatch: true }], |
| | '@typescript-eslint/no-unused-vars': 'error', |
| | 'prefer-const': ['error', { destructuring: 'all' }], |
| |
|
| | |
| | 'no-redeclare': 'off', |
| | 'i18n-text/no-en': 'off', |
| | 'filenames/match-regex': 'off', |
| | camelcase: 'off', |
| |
|
| | |
| | 'no-console': 'off', |
| | '@typescript-eslint/no-explicit-any': 'off', |
| | }, |
| | }, |
| |
|
| | |
| | { |
| | ignores: [ |
| | 'tmp/*', |
| | '.next/', |
| | 'rest-api-description/', |
| | 'docs-internal-data/', |
| | 'src/code-scanning/scripts/generate-code-scanning-query-list.ts', |
| | 'next-env.d.ts', |
| | ], |
| | }, |
| |
|
| | |
| | prettier, |
| | ] |
| |
|