X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=eslint.config.js;h=6288f9b9c646fb7a0fb18f656cd92a81aa1b1ac5;hb=9451bebdd6d0b7c9b5dded635ee391e116f869e1;hp=0f1bd02ecf18c283f5e7ba53cac1b3ffcaf96699;hpb=937e8172c579605e1ed1a286f7c8c9fa743394d8;p=poolifier.git diff --git a/eslint.config.js b/eslint.config.js index 0f1bd02e..6288f9b9 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -17,8 +17,15 @@ 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), + { + rules: { + 'jsdoc/check-tag-names': ['warn', { typed: true, definedTags: ['defaultValue', 'experimental', 'typeParam'] }], + }, + }, + ...tseslint.config( + ...tseslint.configs.strictTypeChecked, + ...tseslint.configs.stylisticTypeChecked + ), ...neostandard({ ts: true, globals: { @@ -26,11 +33,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 +76,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: {