-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
263 additions
and
120 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,85 @@ | ||
const defaultConfig = { | ||
plugins: ['prettier'], | ||
extends: ['eslint:recommended'], | ||
rules: { | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/ban-ts-ignore': 'off', | ||
'consistent-return': 'off', | ||
curly: 'error', | ||
'dot-notation': 'error', | ||
eqeqeq: 'error', | ||
'func-names': ['error', 'always'], | ||
'guard-for-in': 'error', | ||
'linebreak-style': ['error', 'unix'], | ||
'new-cap': 'warn', | ||
'no-caller': 'error', | ||
'no-catch-shadow': 'error', | ||
'no-console': 'error', | ||
'no-else-return': 'error', | ||
'no-extend-native': 'error', | ||
'no-extra-bind': 'error', | ||
'no-eval': 'error', | ||
'no-implicit-coercion': 'error', | ||
'no-implied-eval': 'error', | ||
'no-invalid-this': 'error', | ||
'no-irregular-whitespace': 'error', | ||
'no-labels': 'error', | ||
'no-lone-blocks': 'error', | ||
'no-lonely-if': 'warn', | ||
'no-loop-func': 'error', | ||
'no-multi-spaces': 'warn', | ||
'no-multiple-empty-lines': 'warn', | ||
'no-native-reassign': 'error', | ||
'no-nested-ternary': 'error', | ||
'no-new': 'error', | ||
'no-new-func': 'error', | ||
'no-new-require': 'error', | ||
'no-new-wrappers': 'error', | ||
'no-return-assign': 'error', | ||
'no-self-compare': 'error', | ||
'no-sequences': 'error', | ||
'no-shadow': 'error', | ||
'no-shadow-restricted-names': 'error', | ||
'no-throw-literal': 'error', | ||
'no-undef': 'error', | ||
'no-undef-init': 'warn', | ||
'no-unreachable': 'error', | ||
'no-unused-expressions': ['error', { allowShortCircuit: true }], | ||
'no-useless-call': 'error', | ||
'no-with': 'error', | ||
'require-atomic-updates': 'off', | ||
semi: ['error', 'always'], | ||
strict: ['error', 'global'], | ||
'vars-on-top': 'error', | ||
yoda: ['error', 'never'], | ||
'sort-keys': ['error', 'asc'], | ||
'keyword-spacing': ['error', { before: true, after: true }], | ||
'object-curly-spacing': ['error', 'always'], | ||
'comma-spacing': 'error', | ||
'no-return-await': 'error', | ||
import js from '@eslint/js'; | ||
import { TSESLint } from '@typescript-eslint/utils'; | ||
import jest from 'eslint-plugin-jest'; | ||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'; | ||
|
||
// Plugins custom rules | ||
'kuzzle/array-foreach': 'error', | ||
'prettier/prettier': 'error', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['tests/**/*.js', 'features*/**/*.js'], | ||
extends: ['plugin:jest/recommended', 'plugin:jest/style'], | ||
rules: { | ||
'sort-keys': 'off', | ||
}, | ||
const defaultConfig = (plugin: TSESLint.FlatConfig.Plugin): TSESLint.FlatConfig.Config[] => [ | ||
js.configs.recommended, | ||
{ | ||
plugins: { | ||
[plugin.meta!.name!]: plugin, | ||
}, | ||
{ | ||
files: ['tests/**/*.ts'], | ||
extends: ['plugin:jest/recommended', 'plugin:jest/style'], | ||
parserOptions: { | ||
parser: '@typescript-eslint/parser', | ||
}, | ||
rules: { | ||
'sort-keys': 'off', | ||
}, | ||
rules: { | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/ban-ts-ignore': 'off', | ||
'consistent-return': 'off', | ||
curly: 'error', | ||
'dot-notation': 'error', | ||
eqeqeq: 'error', | ||
'func-names': ['error', 'always'], | ||
'guard-for-in': 'error', | ||
'linebreak-style': ['error', 'unix'], | ||
'new-cap': 'warn', | ||
'no-caller': 'error', | ||
'no-catch-shadow': 'error', | ||
'no-console': 'error', | ||
'no-else-return': 'error', | ||
'no-extend-native': 'error', | ||
'no-extra-bind': 'error', | ||
'no-eval': 'error', | ||
'no-implicit-coercion': 'error', | ||
'no-implied-eval': 'error', | ||
'no-invalid-this': 'error', | ||
'no-irregular-whitespace': 'error', | ||
'no-labels': 'error', | ||
'no-lone-blocks': 'error', | ||
'no-lonely-if': 'warn', | ||
'no-loop-func': 'error', | ||
'no-multi-spaces': 'warn', | ||
'no-multiple-empty-lines': 'warn', | ||
'no-native-reassign': 'error', | ||
'no-nested-ternary': 'error', | ||
'no-new': 'error', | ||
'no-new-func': 'error', | ||
'no-new-require': 'error', | ||
'no-new-wrappers': 'error', | ||
'no-return-assign': 'error', | ||
'no-self-compare': 'error', | ||
'no-sequences': 'error', | ||
'no-shadow': 'error', | ||
'no-shadow-restricted-names': 'error', | ||
'no-throw-literal': 'error', | ||
'no-undef': 'error', | ||
'no-undef-init': 'warn', | ||
'no-unreachable': 'error', | ||
'no-unused-expressions': ['error', { allowShortCircuit: true }], | ||
'no-useless-call': 'error', | ||
'no-with': 'error', | ||
'require-atomic-updates': 'off', | ||
semi: ['error', 'always'], | ||
strict: ['error', 'global'], | ||
'vars-on-top': 'error', | ||
yoda: ['error', 'never'], | ||
'sort-keys': ['error', 'asc'], | ||
'keyword-spacing': ['error', { before: true, after: true }], | ||
'object-curly-spacing': ['error', 'always'], | ||
'comma-spacing': 'error', | ||
'no-return-await': 'error', | ||
|
||
// Plugins custom rules | ||
'kuzzle/array-foreach': 'error', | ||
'prettier/prettier': 'error', | ||
}, | ||
], | ||
}; | ||
}, | ||
{ | ||
files: ['tests/**/*.js', 'features*/**/*.js'], | ||
...jest.configs['flat/recommended'], | ||
...jest.configs['flat/style'], | ||
rules: { | ||
'sort-keys': 'off', | ||
}, | ||
}, | ||
eslintPluginPrettierRecommended, | ||
]; | ||
|
||
export default defaultConfig; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,34 @@ | ||
const typescriptConfig = { | ||
plugins: ['@typescript-eslint'], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: ['**/tsconfig.json', '**/tsconfig.*.json'], | ||
import jest from 'eslint-plugin-jest'; | ||
import tseslint from 'typescript-eslint'; | ||
|
||
const typescriptConfig = tseslint.config( | ||
...tseslint.configs.recommended, | ||
tseslint.configs.eslintRecommended, | ||
{ | ||
languageOptions: { | ||
parserOptions: { | ||
projectService: true, | ||
}, | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/type-annotation-spacing': 'warn', | ||
'@typescript-eslint/member-delimiter-style': 'warn', | ||
// Fix for https://github.com/typescript-eslint/typescript-eslint/issues/2483 | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': 'error', | ||
}, | ||
}, | ||
rules: { | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/explicit-module-boundary-types': 'off', | ||
'@typescript-eslint/ban-ts-comment': 'off', | ||
'@typescript-eslint/type-annotation-spacing': 'warn', | ||
'@typescript-eslint/member-delimiter-style': 'warn', | ||
// Fix for https://github.com/typescript-eslint/typescript-eslint/issues/2483 | ||
'no-shadow': 'off', | ||
'@typescript-eslint/no-shadow': 'error', | ||
{ | ||
files: ['tests/**/*.ts'], | ||
...jest.configs['flat/recommended'], | ||
...jest.configs['flat/style'], | ||
rules: { | ||
'sort-keys': 'off', | ||
}, | ||
}, | ||
}; | ||
); | ||
|
||
export default typescriptConfig; |
Oops, something went wrong.