From 147d7c422fc8ba900126ff50097dc2b00494dfff Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 30 May 2024 21:12:52 +0200 Subject: [PATCH] fix: add missing eslint flat configuration MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- eslint.config.js | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 eslint.config.js 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', + }, + }, +]) -- 2.34.1