From: Jérôme Benoit Date: Thu, 30 May 2024 19:12:52 +0000 (+0200) Subject: fix: add missing eslint flat configuration X-Git-Tag: v4.0.14~41 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=147d7c422fc8ba900126ff50097dc2b00494dfff;p=poolifier.git fix: add missing eslint flat configuration Signed-off-by: Jérôme Benoit --- diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..fd2c801d --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,58 @@ +import cspellConfigs from '@cspell/eslint-plugin/configs' +import js from '@eslint/js' +import { defineFlatConfig } from 'eslint-define-config' +import jsdoc from 'eslint-plugin-jsdoc' +import nodePlugin from 'eslint-plugin-n' +import simpleImportSort from 'eslint-plugin-simple-import-sort' +import globals from 'globals' +import neostandard from 'neostandard' +// eslint-disable-next-line n/no-extraneous-import +import tseslint from 'typescript-eslint' + +export default defineFlatConfig([ + { + ignores: ['docs/**', '**/dist/**', 'lib/**', 'outputs/**'], + }, + cspellConfigs.recommended, + 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), + ...neostandard({ + ts: true, + globals: { + ...globals.node, + ...globals.mocha, + }, + }), + { + plugins: { + 'simple-import-sort': simpleImportSort, + }, + rules: { + 'simple-import-sort/imports': 'error', + 'simple-import-sort/exports': 'error', + }, + }, + { + files: [ + 'src/pools/selection-strategies/fair-share-worker-choice-strategy.ts', + ], + rules: { + '@stylistic/operator-linebreak': 'off', + }, + }, + { + files: ['tests/**/*.cjs', 'benchmarks/**/*.cjs', 'examples/**/*.cjs'], + rules: { + '@typescript-eslint/no-require-imports': 'off', + }, + }, + { + files: ['tests/**/*.cjs', 'tests/**/*.js', 'tests/**/*.mjs'], + rules: { + '@typescript-eslint/no-empty-function': 'off', + }, + }, +])