From 71565bdb5ea9b57bf826725ac2f5a3f8d8cd9c2b Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Mon, 18 Nov 2024 07:17:52 +1300 Subject: [PATCH] feat: add names to configs --- @typescript-eslint.js | 1 + eslint.config.js | 5 ++++- index.js | 2 ++ jest.js | 1 + react.js | 2 ++ 5 files changed, 10 insertions(+), 1 deletion(-) diff --git a/@typescript-eslint.js b/@typescript-eslint.js index 2a20b978..423fd248 100644 --- a/@typescript-eslint.js +++ b/@typescript-eslint.js @@ -167,6 +167,7 @@ const generateConfig = () => { /** @type {import('eslint').Linter.FlatConfig[]} */ const config = [ { + name: 'ackama/@typescript-eslint', languageOptions: { parser: parserTypeScriptESLint }, plugins: { '@typescript-eslint': pluginTypeScriptESLint, diff --git a/eslint.config.js b/eslint.config.js index 48c86c3b..780045a4 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -5,12 +5,13 @@ const configAckamaJest = require('./jest'); /** @type {import('eslint').Linter.FlatConfig[]} */ const config = [ - { files: ['**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}'] }, + { name: 'custom: files', files: ['**/*.{js,jsx,cjs,mjs,ts,tsx,cts,mts}'] }, .../** @type {import('eslint').Linter.FlatConfig[]} */ (configAckamaBase), .../** @type {import('eslint').Linter.FlatConfig[]} */ ( configAckamaTypeScript ), { + name: 'custom: options', languageOptions: { parserOptions: { project: true }, globals: globals.node @@ -20,6 +21,7 @@ const config = [ c => ({ ...c, files: ['**/*.spec.*'] }) ), { + name: 'custom: JavaScript scripts', files: ['**/*.js'], languageOptions: { sourceType: 'script' }, rules: { @@ -28,6 +30,7 @@ const config = [ } }, { + name: 'custom: declaration files', files: ['**/*.d.ts'], rules: { 'max-classes-per-file': 'off' diff --git a/index.js b/index.js index a51be779..4bb6c683 100644 --- a/index.js +++ b/index.js @@ -196,6 +196,7 @@ const generateConfig = () => { /** @type {import('eslint').Linter.FlatConfig[]} */ const config = [ { + name: 'ackama/ignores', ignores: [ // todo: this shouldn't be needed anymore, but we've kept it for now as it doesn't hurt '!.eslintrc.js', @@ -210,6 +211,7 @@ const generateConfig = () => { ] }, { + name: 'ackama/javascript', plugins: { ...pluginEslintCommentsConfigs.recommended.plugins, '@stylistic/js': pluginStylisticJS, diff --git a/jest.js b/jest.js index 990e1d3a..5c60a4a0 100644 --- a/jest.js +++ b/jest.js @@ -78,6 +78,7 @@ const generateConfig = () => { /** @type {import('eslint').Linter.FlatConfig[]} */ const config = [ { + name: 'ackama/jest', ...pluginJest.configs['flat/recommended'], plugins: { jest: pluginJest }, rules: { diff --git a/react.js b/react.js index a479f532..cbb692f5 100644 --- a/react.js +++ b/react.js @@ -72,6 +72,7 @@ const generateConfig = () => { /** @type {import('eslint').Linter.FlatConfig[]} */ const config = [ { + name: 'ackama/react', languageOptions: { parserOptions: { ecmaFeatures: { @@ -99,6 +100,7 @@ const generateConfig = () => { } }, { + name: 'ackama/react/tsx', files: ['**/*.tsx'], rules: { 'react/no-unknown-property': 'off',