X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=eslint.config.js;h=67eb035ecc938597a02c8ed0561dd4fc1dc80601;hb=467aa7afd51fa603b1c62767dc29bda3cde9e398;hp=67c827ae3c72afe9033dd01e242aa94be21d0da0;hpb=5cc0b90f9f6d69de0558205fa99b1526a015b006;p=poolifier.git diff --git a/eslint.config.js b/eslint.config.js index 67c827ae..67eb035e 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -17,8 +17,10 @@ export default defineFlatConfig([ js.configs.recommended, ...nodePlugin.configs['flat/mixed-esm-and-cjs'], jsdoc.configs['flat/recommended-typescript'], - // ...tseslint.config(...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked), - ...tseslint.config(...tseslint.configs.strict, ...tseslint.configs.stylistic), + ...tseslint.config( + ...tseslint.configs.strictTypeChecked, + ...tseslint.configs.stylisticTypeChecked + ), ...neostandard({ ts: true, globals: { @@ -26,11 +28,37 @@ export default defineFlatConfig([ ...globals.mocha, }, }), + { + languageOptions: { + parserOptions: { + project: true, + tsconfigRootDir: import.meta.dirname, + }, + }, + }, { plugins: { 'simple-import-sort': simpleImportSort, }, rules: { + '@cspell/spellchecker': [ + 'warn', + { + autoFix: true, + cspell: { + words: [ + 'Alessandro', + 'Ardizio', + 'Benoit', + 'IWRR', + 'Quadflieg', + 'neostandard', + 'poolifier', + 'tseslint', + ], + }, + }, + ], 'simple-import-sort/imports': 'error', 'simple-import-sort/exports': 'error', }, @@ -43,10 +71,21 @@ export default defineFlatConfig([ '@stylistic/operator-linebreak': 'off', }, }, + { + files: ['**/*.js', '**/*.mjs', '**/*.cjs'], + ...tseslint.configs.disableTypeChecked, + }, + // examples specific configuration { files: ['examples/**/*.ts'], rules: { - 'no-undef': 'off', + '@typescript-eslint/no-unsafe-argument': 'off', + '@typescript-eslint/no-unsafe-call': 'off', + '@typescript-eslint/no-unsafe-return': 'off', + '@typescript-eslint/no-unsafe-assignment': 'off', + '@typescript-eslint/no-unsafe-member-access': 'off', + '@typescript-eslint/no-unnecessary-type-assertion': 'off', + '@typescript-eslint/no-redundant-type-constituents': 'off', }, }, { @@ -61,12 +100,14 @@ export default defineFlatConfig([ '@typescript-eslint/no-require-imports': 'off', }, }, + // benchmarks specific configuration { files: ['benchmarks/**/*.cjs'], rules: { '@typescript-eslint/no-require-imports': 'off', }, }, + // tests specific configuration { files: ['tests/**/*.js', 'tests/**/*.mjs', 'tests/**/*.cjs'], rules: {