diff --git a/README.md b/README.md index 58da9d8..d8c6180 100644 --- a/README.md +++ b/README.md @@ -17,10 +17,10 @@ Create a file in the root of your project named `eslint.config.js`, or `eslint.c Populate it with the following content: ```js -import { config, looseTypes, configWithoutJest, configWithoutTypescript } from '@fishbrain/eslint-config-base'; +import { config, looseTypes, configWithoutJest } from '@fishbrain/eslint-config-base'; export default [ - ...config, // or configWithoutJest or configWithoutTypescript depending on the needs of the project. + ...config, // or configWithoutJest if the project doesn't use Jest. ...looseTypes, // Use this if the project is poorly typed. ]; ``` diff --git a/package.json b/package.json index 52a6a30..7563171 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@fishbrain/eslint-config-monorepo", "private": true, "description": "ESLint configs for Fishbrain projects", - "version": "6.1.2", + "version": "6.1.3", "workspaces": [ "packages/*" ], diff --git a/packages/base/index.js b/packages/base/index.js index 740916b..bb3405f 100644 --- a/packages/base/index.js +++ b/packages/base/index.js @@ -35,19 +35,6 @@ const baseConfig = [ ]; const customRules = { - rules: { - curly: ['error', 'all'], - 'max-lines': ['error', { max: 300, skipComments: true }], - 'no-magic-numbers': [ - 'error', - { ignoreArrayIndexes: true, ignore: ALLOWED_NUMBERS }, - ], - 'prettier/prettier': 'error', - 'require-atomic-updates': 'error', - }, -}; - -const customRulesTypescript = { rules: { '@typescript-eslint/no-empty-function': 'off', // Noop functions are a common pattern we use during testing, so we don't want to enable it. '@typescript-eslint/no-explicit-any': ['error', { fixToUnknown: true }], @@ -67,29 +54,24 @@ const customRulesTypescript = { allowNumber: true, }, ], + curly: ['error', 'all'], + 'max-lines': ['error', { max: 300, skipComments: true }], + 'no-magic-numbers': [ + 'error', + { ignoreArrayIndexes: true, ignore: ALLOWED_NUMBERS }, + ], + 'prettier/prettier': 'error', + 'require-atomic-updates': 'error', }, }; -export const configWithoutTypescript = [ - eslint.configs.recommended, - { plugins: { prettier: prettierPlugin } }, - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access - jestPlugin.configs['flat/recommended'], - customRules, -]; - -export const configWithoutJest = tseslint.config( - ...baseConfig, - customRules, - customRulesTypescript, -); +export const configWithoutJest = tseslint.config(...baseConfig, customRules); export const config = tseslint.config( ...baseConfig, // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access jestPlugin.configs['flat/recommended'], customRules, - customRulesTypescript, ); /* Use this if your project is not well typed yet (e.g. lots of `any` types). Ideally you should not use this, but in some cases it may be necessary. */ diff --git a/packages/base/package.json b/packages/base/package.json index d8510a7..5f6a2ce 100644 --- a/packages/base/package.json +++ b/packages/base/package.json @@ -1,7 +1,7 @@ { "name": "@fishbrain/eslint-config-base", "packageManager": "yarn@4.4.1", - "version": "6.1.2", + "version": "6.1.3", "type": "module", "exports": "./index.js", "scripts": { diff --git a/packages/react/index.js b/packages/react/index.js index bd0b434..b56081f 100644 --- a/packages/react/index.js +++ b/packages/react/index.js @@ -55,13 +55,6 @@ const customRules = { }, }; -export const configWithoutTypescript = [ - ...baseConfig, - ...reactConfig, - ...testingConfig, - customRules, -]; - export const config = tseslint.config( ...baseConfig, ...reactConfig, diff --git a/packages/react/package.json b/packages/react/package.json index c0d45fd..9319915 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@fishbrain/eslint-config-react", "packageManager": "yarn@4.4.1", - "version": "6.1.2", + "version": "6.1.3", "type": "module", "exports": "./index.js", "scripts": {