X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=eslint.config.js;h=67eb035ecc938597a02c8ed0561dd4fc1dc80601;hb=1514944d2861b75bf40f0543b72728c6030a67f6;hp=0f1bd02ecf18c283f5e7ba53cac1b3ffcaf96699;hpb=937e8172c579605e1ed1a286f7c8c9fa743394d8;p=poolifier.git diff --git a/eslint.config.js b/eslint.config.js index 0f1bd02e..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,20 +71,43 @@ export default defineFlatConfig([ '@stylistic/operator-linebreak': 'off', }, }, + { + files: ['**/*.js', '**/*.mjs', '**/*.cjs'], + ...tseslint.configs.disableTypeChecked, + }, + // examples specific configuration + { + files: ['examples/**/*.ts'], + rules: { + '@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', + }, + }, { files: ['examples/**/*.js', 'examples/**/*.cjs'], rules: { - 'no-undef': 'off', - 'n/no-missing-import': 'off', + 'n/no-missing-import': [ + 'error', + { + allowModules: ['ws'], + }, + ], '@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: {