eslint-define-config
Advanced tools
Comparing version 1.17.0 to 1.20.0
{ | ||
"name": "eslint-define-config", | ||
"version": "1.17.0", | ||
"version": "1.20.0", | ||
"description": "Provide a defineConfig function for .eslintrc.js files", | ||
@@ -8,6 +8,6 @@ "main": "src/index.js", | ||
"scripts": { | ||
"clean": "rm -Rf dist pnpm-lock.yaml node_modules", | ||
"clean": "rimraf .eslintcache dist pnpm-lock.yaml node_modules", | ||
"check": "tsc", | ||
"format": "prettier --write .", | ||
"lint": "eslint .", | ||
"format": "prettier --cache --write .", | ||
"lint": "eslint --cache --cache-strategy content --report-unused-disable-directives .", | ||
"typecheck": "vitest typecheck", | ||
@@ -55,30 +55,35 @@ "test": "vitest", | ||
"devDependencies": { | ||
"@graphql-eslint/eslint-plugin": "~3.16.1", | ||
"@graphql-eslint/eslint-plugin": "~3.18.0", | ||
"@intlify/eslint-plugin-vue-i18n": "~2.0.0", | ||
"@poppinss/cliui": "~3.0.5", | ||
"@types/eslint": "~8.21.2", | ||
"@types/eslint": "~8.37.0", | ||
"@types/json-schema": "~7.0.11", | ||
"@types/node": "~18.15.3", | ||
"@types/node": "~18.16.1", | ||
"@types/prettier": "~2.7.2", | ||
"@typescript-eslint/eslint-plugin": "~5.55.0", | ||
"@typescript-eslint/parser": "~5.55.0", | ||
"@typescript-eslint/eslint-plugin": "~5.59.1", | ||
"@typescript-eslint/parser": "~5.59.1", | ||
"change-case": "~4.1.2", | ||
"eslint": "~8.36.0", | ||
"eslint-config-prettier": "~8.7.0", | ||
"eslint": "~8.39.0", | ||
"eslint-config-prettier": "~8.8.0", | ||
"eslint-gitignore": "~0.1.0", | ||
"eslint-plugin-deprecation": "~1.3.3", | ||
"eslint-plugin-deprecation": "~1.4.1", | ||
"eslint-plugin-eslint-comments": "~3.2.0", | ||
"eslint-plugin-import": "~2.27.5", | ||
"eslint-plugin-inclusive-language": "~2.2.0", | ||
"eslint-plugin-jsdoc": "~40.0.3", | ||
"eslint-plugin-jsdoc": "~43.1.1", | ||
"eslint-plugin-jsonc": "~2.7.0", | ||
"eslint-plugin-jsx-a11y": "~6.7.1", | ||
"eslint-plugin-mdx": "~2.0.5", | ||
"eslint-plugin-n": "~15.6.1", | ||
"eslint-plugin-n": "~15.7.0", | ||
"eslint-plugin-node": "~11.1.0", | ||
"eslint-plugin-prettier": "~4.2.1", | ||
"eslint-plugin-promise": "~6.1.1", | ||
"eslint-plugin-sonarjs": "~0.18.0", | ||
"eslint-plugin-react": "~7.32.2", | ||
"eslint-plugin-react-hooks": "~4.6.0", | ||
"eslint-plugin-sonarjs": "~0.19.0", | ||
"eslint-plugin-spellcheck": "~0.0.20", | ||
"eslint-plugin-testing-library": "~5.10.3", | ||
"eslint-plugin-unicorn": "~46.0.0", | ||
"eslint-plugin-vue": "~9.9.0", | ||
"eslint-plugin-vitest": "~0.1.4", | ||
"eslint-plugin-vue": "~9.11.0", | ||
"eslint-plugin-vue-pug": "~0.6.0", | ||
@@ -88,12 +93,13 @@ "expect-type": "~0.15.0", | ||
"json-schema": "~0.4.0", | ||
"json-schema-to-ts": "~2.7.2", | ||
"json-schema-to-ts": "~2.8.0", | ||
"json-schema-to-typescript": "~12.0.0", | ||
"prettier": "2.8.4", | ||
"prettier": "2.8.8", | ||
"prettier-plugin-organize-imports": "~3.2.2", | ||
"rimraf": "~5.0.0", | ||
"ts-dedent": "~2.2.0", | ||
"tsx": "~3.12.5", | ||
"typescript": "~5.0.2", | ||
"tsx": "~3.12.6", | ||
"typescript": "~5.0.4", | ||
"upper-case-first": "~2.0.2", | ||
"vitest": "~0.29.3", | ||
"vue-eslint-parser": "~9.1.0" | ||
"vitest": "~0.30.1", | ||
"vue-eslint-parser": "~9.1.1" | ||
}, | ||
@@ -109,3 +115,3 @@ "pnpm": { | ||
}, | ||
"packageManager": "pnpm@7.29.3", | ||
"packageManager": "pnpm@8.3.1", | ||
"engines": { | ||
@@ -112,0 +118,0 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0", |
@@ -13,4 +13,8 @@ import type { LiteralUnion } from '../../utility-types'; | ||
import type { PromiseExtensions } from './eslint-plugin-promise'; | ||
import type { ReactExtensions } from './eslint-plugin-react'; | ||
import type { ReactHooksExtensions } from './eslint-plugin-react-hooks'; | ||
import type { SonarjsExtensions } from './eslint-plugin-sonarjs'; | ||
import type { TestingLibraryExtensions } from './eslint-plugin-testing-library'; | ||
import type { UnicornExtensions } from './eslint-plugin-unicorn'; | ||
import type { VitestExtensions } from './eslint-plugin-vitest'; | ||
import type { VueExtensions } from './eslint-plugin-vue'; | ||
@@ -37,5 +41,9 @@ import type { VuePugExtensions } from './eslint-plugin-vue-pug'; | ||
| PromiseExtensions | ||
| ReactExtensions | ||
| ReactHooksExtensions | ||
| SonarjsExtensions | ||
| TestingLibraryExtensions | ||
| TypescriptEslintExtensions | ||
| UnicornExtensions | ||
| VitestExtensions | ||
| VueExtensions | ||
@@ -50,2 +58,2 @@ | VuePugExtensions | ||
*/ | ||
export type Extends = KnownExtensions | Array<KnownExtensions>; | ||
export type Extends = KnownExtensions | KnownExtensions[]; |
@@ -96,2 +96,2 @@ import type { Parser, ParserOptions } from '../parser-options'; | ||
*/ | ||
export type Overrides = Array<Override>; | ||
export type Overrides = Override[]; |
@@ -11,9 +11,14 @@ import type { LiteralUnion } from '../utility-types'; | ||
| 'jsdoc' | ||
| 'jsx-a11y' | ||
| 'mdx' | ||
| 'prettier' | ||
| 'promise' | ||
| 'react-hooks' | ||
| 'react' | ||
| 'sonarjs' | ||
| 'spellcheck' | ||
| 'testing-library' | ||
| 'unicorn' | ||
| 'vitest' | ||
| 'vue' | ||
>; |
import type { ImportSettings } from './import'; | ||
import type { JSDocSettings } from './jsdoc'; | ||
import type { JsxA11ySettings } from './jsx-a11y'; | ||
import type { MdxSettings } from './mdx'; | ||
import type { NodeSettings } from './node'; | ||
import type { ReactSettings } from './react'; | ||
@@ -12,4 +14,6 @@ /** | ||
JSDocSettings, | ||
JsxA11ySettings, | ||
MdxSettings, | ||
NodeSettings, | ||
ReactSettings, | ||
Partial<Record<string, unknown>> {} |
@@ -64,2 +64,3 @@ import type { ESLint, Linter } from 'eslint'; | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
settings?: Record<string, any>; | ||
@@ -66,0 +67,0 @@ } |
@@ -31,3 +31,3 @@ import type { ESLintConfig } from './config'; | ||
export function defineFlatConfig( | ||
config: readonly FlatESLintConfig[], | ||
config: ReadonlyArray<FlatESLintConfig>, | ||
): FlatESLintConfig[]; | ||
@@ -34,0 +34,0 @@ |
@@ -265,3 +265,3 @@ import type { LiteralUnion } from './utility-types'; | ||
*/ | ||
project?: string | string[] | null; | ||
project?: string | string[] | true | null; | ||
@@ -268,0 +268,0 @@ /** |
@@ -26,3 +26,3 @@ import type { RuleConfig } from '../rule-config'; | ||
/** | ||
* Require or disallow logical assignment logical operator shorthand. | ||
* Require or disallow logical assignment operator shorthand. | ||
* | ||
@@ -35,3 +35,3 @@ * @see [logical-assignment-operators](https://eslint.org/docs/rules/logical-assignment-operators) | ||
/** | ||
* Require or disallow logical assignment logical operator shorthand. | ||
* Require or disallow logical assignment operator shorthand. | ||
* | ||
@@ -42,3 +42,3 @@ * @see [logical-assignment-operators](https://eslint.org/docs/rules/logical-assignment-operators) | ||
/** | ||
* Require or disallow logical assignment logical operator shorthand. | ||
* Require or disallow logical assignment operator shorthand. | ||
* | ||
@@ -45,0 +45,0 @@ * @see [logical-assignment-operators](https://eslint.org/docs/rules/logical-assignment-operators) |
@@ -6,3 +6,3 @@ import type { RuleConfig } from '../rule-config'; | ||
*/ | ||
export type NewParensOption = [] | ['always' | 'never']; | ||
export type NewParensOption = 'always' | 'never'; | ||
@@ -12,3 +12,3 @@ /** | ||
*/ | ||
export type NewParensOptions = NewParensOption; | ||
export type NewParensOptions = [NewParensOption?]; | ||
@@ -15,0 +15,0 @@ /** |
import type { RuleConfig } from '../rule-config'; | ||
/** | ||
* Disallow division operators explicitly at the beginning of regular expressions. | ||
* Disallow equal signs explicitly at the beginning of regular expressions. | ||
* | ||
@@ -11,3 +11,3 @@ * @see [no-div-regex](https://eslint.org/docs/rules/no-div-regex) | ||
/** | ||
* Disallow division operators explicitly at the beginning of regular expressions. | ||
* Disallow equal signs explicitly at the beginning of regular expressions. | ||
* | ||
@@ -18,3 +18,3 @@ * @see [no-div-regex](https://eslint.org/docs/rules/no-div-regex) | ||
/** | ||
* Disallow division operators explicitly at the beginning of regular expressions. | ||
* Disallow equal signs explicitly at the beginning of regular expressions. | ||
* | ||
@@ -21,0 +21,0 @@ * @see [no-div-regex](https://eslint.org/docs/rules/no-div-regex) |
@@ -81,2 +81,4 @@ import type { RuleConfig } from '../rule-config'; | ||
allowTrailingUnderscore?: boolean; | ||
} & { | ||
[k: string]: AsString | AsObject; | ||
}, | ||
@@ -102,2 +104,10 @@ ]; | ||
/** | ||
* @minItems 1 | ||
*/ | ||
requiredPrefixes?: [string, ...string[]]; | ||
/** | ||
* @minItems 1 | ||
*/ | ||
requiredSuffixes?: [string, ...string[]]; | ||
/** | ||
* Option to skip validation of some words, e.g. acronyms | ||
@@ -104,0 +114,0 @@ */ |
@@ -8,10 +8,15 @@ import type { DeprecationRules } from './deprecation'; | ||
import type { JsoncRules } from './jsonc'; | ||
import type { JsxA11yRules } from './jsx-a11y'; | ||
import type { NRules } from './n'; | ||
import type { NodeRules } from './node'; | ||
import type { PromiseRules } from './promise'; | ||
import type { ReactRules } from './react'; | ||
import type { ReactHooksRules } from './react-hooks'; | ||
import type { RuleConfig } from './rule-config'; | ||
import type { SonarJSRules } from './sonarjs'; | ||
import type { SpellcheckRules } from './spellcheck'; | ||
import type { TestingLibraryRules } from './testing-library'; | ||
import type { TypeScriptRules } from './typescript-eslint'; | ||
import type { UnicornRules } from './unicorn'; | ||
import type { VitestRules } from './vitest'; | ||
import type { VueRules } from './vue'; | ||
@@ -34,9 +39,14 @@ import type { VueI18nRules } from './vue-i18n'; | ||
JsoncRules & | ||
JsxA11yRules & | ||
NodeRules & | ||
NRules & | ||
PromiseRules & | ||
ReactHooksRules & | ||
ReactRules & | ||
SonarJSRules & | ||
SpellcheckRules & | ||
TestingLibraryRules & | ||
TypeScriptRules & | ||
UnicornRules & | ||
VitestRules & | ||
VueRules & | ||
@@ -43,0 +53,0 @@ VueI18nRules & |
@@ -8,3 +8,5 @@ import type { RuleConfig } from '../rule-config'; | ||
definedTags?: string[]; | ||
enableFixer?: boolean; | ||
jsxTags?: boolean; | ||
typed?: boolean; | ||
} | ||
@@ -11,0 +13,0 @@ |
@@ -14,7 +14,9 @@ import type { CheckAccessRule } from './check-access'; | ||
import type { ImplementsOnClassesRule } from './implements-on-classes'; | ||
import type { InformativeDocsRule } from './informative-docs'; | ||
import type { MatchDescriptionRule } from './match-description'; | ||
import type { MatchNameRule } from './match-name'; | ||
import type { MultilineBlocksRule } from './multiline-blocks'; | ||
import type { NewlineAfterDescriptionRule } from './newline-after-description'; | ||
import type { NoBadBlocksRule } from './no-bad-blocks'; | ||
import type { NoBlankBlockDescriptionsRule } from './no-blank-block-descriptions'; | ||
import type { NoBlankBlocksRule } from './no-blank-blocks'; | ||
import type { NoDefaultsRule } from './no-defaults'; | ||
@@ -69,7 +71,9 @@ import type { NoMissingSyntaxRule } from './no-missing-syntax'; | ||
ImplementsOnClassesRule & | ||
InformativeDocsRule & | ||
MatchDescriptionRule & | ||
MatchNameRule & | ||
MultilineBlocksRule & | ||
NewlineAfterDescriptionRule & | ||
NoBadBlocksRule & | ||
NoBlankBlockDescriptionsRule & | ||
NoBlankBlocksRule & | ||
NoDefaultsRule & | ||
@@ -76,0 +80,0 @@ NoMissingSyntaxRule & |
@@ -16,3 +16,2 @@ import type { RuleConfig } from '../rule-config'; | ||
}[]; | ||
[k: string]: any; | ||
} | ||
@@ -19,0 +18,0 @@ |
@@ -15,3 +15,2 @@ import type { RuleConfig } from '../rule-config'; | ||
singleLineTags?: string[]; | ||
[k: string]: any; | ||
} | ||
@@ -18,0 +17,0 @@ |
@@ -10,3 +10,2 @@ import type { RuleConfig } from '../rule-config'; | ||
preventAtMiddleLines?: boolean; | ||
[k: string]: any; | ||
} | ||
@@ -13,0 +12,0 @@ |
@@ -8,4 +8,9 @@ import type { RuleConfig } from '../rule-config'; | ||
alphabetizeExtras?: boolean; | ||
tagSequence?: string[]; | ||
[k: string]: any; | ||
linesBetween?: number; | ||
reportIntraTagGroupSpacing?: boolean; | ||
reportTagGroupSpacing?: boolean; | ||
tagSequence?: { | ||
tags?: string[]; | ||
[k: string]: any; | ||
}[]; | ||
} | ||
@@ -19,2 +24,3 @@ | ||
/** | ||
* Sorts tags by a specified sequence according to tag name. | ||
* | ||
@@ -26,2 +32,3 @@ * @see [sort-tags](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-sort-tags) | ||
/** | ||
* Sorts tags by a specified sequence according to tag name. | ||
* | ||
@@ -32,2 +39,3 @@ * @see [sort-tags](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-sort-tags) | ||
/** | ||
* Sorts tags by a specified sequence according to tag name. | ||
* | ||
@@ -34,0 +42,0 @@ * @see [sort-tags](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-sort-tags) |
@@ -7,5 +7,6 @@ import type { RuleConfig } from '../rule-config'; | ||
export interface TagLinesConfig { | ||
applyToEndTag?: boolean; | ||
count?: number; | ||
dropEndLines?: boolean; | ||
noEndLines?: boolean; | ||
endLines?: number | null; | ||
startLines?: number | null; | ||
tags?: { | ||
@@ -19,3 +20,2 @@ /** | ||
}; | ||
[k: string]: any; | ||
} | ||
@@ -22,0 +22,0 @@ |
@@ -9,3 +9,2 @@ import type { RuleConfig } from '../rule-config'; | ||
escapeMarkdown?: boolean; | ||
[k: string]: any; | ||
} | ||
@@ -12,0 +11,0 @@ |
@@ -8,3 +8,2 @@ import type { RuleConfig } from '../rule-config'; | ||
allowEmptyNamepaths?: boolean; | ||
[k: string]: any; | ||
} | ||
@@ -11,0 +10,0 @@ |
@@ -44,2 +44,3 @@ import type { RuleConfig } from '../rule-config'; | ||
resolvePaths?: string[]; | ||
ignoreTypeImport?: boolean; | ||
} | ||
@@ -46,0 +47,0 @@ |
@@ -6,9 +6,6 @@ import type { RuleConfig } from '../rule-config'; | ||
*/ | ||
export type FileExtensionInImportConfig = | ||
| { | ||
tryExtensions?: string[]; | ||
} | ||
| { | ||
[k: string]: 'always' | 'never'; | ||
}; | ||
export interface FileExtensionInImportConfig { | ||
tryExtensions?: string[]; | ||
[ext: `.${string}`]: 'always' | 'never'; | ||
} | ||
@@ -15,0 +12,0 @@ /** |
@@ -14,3 +14,3 @@ import type { RuleConfig } from '../rule-config'; | ||
/** | ||
* Related "if/else if" statements should not have the same condition. | ||
* Related "if-else-if" and "switch-case" statements should not have the same condition. | ||
* | ||
@@ -23,3 +23,3 @@ * @see [no-identical-conditions](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/no-identical-conditions.md) | ||
/** | ||
* Related "if/else if" statements should not have the same condition. | ||
* Related "if-else-if" and "switch-case" statements should not have the same condition. | ||
* | ||
@@ -30,3 +30,3 @@ * @see [no-identical-conditions](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/no-identical-conditions.md) | ||
/** | ||
* Related "if/else if" statements should not have the same condition. | ||
* Related "if-else-if" and "switch-case" statements should not have the same condition. | ||
* | ||
@@ -33,0 +33,0 @@ * @see [no-identical-conditions](https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/docs/rules/no-identical-conditions.md) |
@@ -15,2 +15,3 @@ import type { RuleConfig } from '../rule-config'; | ||
fixWith?: string; | ||
suggest?: string[]; | ||
}; | ||
@@ -17,0 +18,0 @@ }; |
@@ -41,2 +41,3 @@ import type { AdjacentOverloadSignaturesRule } from './adjacent-overload-signatures'; | ||
import type { NoDuplicateImportsRule } from './no-duplicate-imports'; | ||
import type { NoDuplicateTypeConstituentsRule } from './no-duplicate-type-constituents'; | ||
import type { NoDynamicDeleteRule } from './no-dynamic-delete'; | ||
@@ -88,2 +89,3 @@ import type { NoEmptyFunctionRule } from './no-empty-function'; | ||
import type { NoUnsafeDeclarationMergingRule } from './no-unsafe-declaration-merging'; | ||
import type { NoUnsafeEnumComparisonRule } from './no-unsafe-enum-comparison'; | ||
import type { NoUnsafeMemberAccessRule } from './no-unsafe-member-access'; | ||
@@ -181,2 +183,3 @@ import type { NoUnsafeReturnRule } from './no-unsafe-return'; | ||
NoDuplicateImportsRule & | ||
NoDuplicateTypeConstituentsRule & | ||
NoDynamicDeleteRule & | ||
@@ -228,2 +231,3 @@ NoEmptyFunctionRule & | ||
NoUnsafeDeclarationMergingRule & | ||
NoUnsafeEnumComparisonRule & | ||
NoUnsafeMemberAccessRule & | ||
@@ -230,0 +234,0 @@ NoUnsafeReturnRule & |
@@ -27,2 +27,6 @@ import type { RuleConfig } from '../rule-config'; | ||
allowRegExp?: boolean; | ||
/** | ||
* Whether to allow `never` typed values in template expressions. | ||
*/ | ||
allowNever?: boolean; | ||
[k: string]: any; | ||
@@ -29,0 +33,0 @@ } |
@@ -7,7 +7,3 @@ import type { RuleConfig } from '../rule-config'; | ||
export interface AttributeHyphenationConfig { | ||
ignore?: (string & { | ||
[k: string]: any; | ||
} & { | ||
[k: string]: any; | ||
})[]; | ||
ignore?: string[]; | ||
} | ||
@@ -14,0 +10,0 @@ |
@@ -18,7 +18,3 @@ import type { RuleConfig } from '../rule-config'; | ||
alignAttributesVertically?: boolean; | ||
ignores?: (string & { | ||
[k: string]: any; | ||
} & { | ||
[k: string]: any; | ||
})[]; | ||
ignores?: string[]; | ||
} | ||
@@ -25,0 +21,0 @@ |
@@ -17,2 +17,6 @@ import type { RuleConfig } from '../rule-config'; | ||
ignorePublicMembers?: boolean; | ||
unreferencedOptions?: ( | ||
| 'unknownMemberAsUnreferenced' | ||
| 'returnAsUnreferenced' | ||
)[]; | ||
} | ||
@@ -19,0 +23,0 @@ |
@@ -9,7 +9,3 @@ import type { RuleConfig } from '../rule-config'; | ||
switchCase?: number; | ||
ignores?: (string & { | ||
[k: string]: any; | ||
} & { | ||
[k: string]: any; | ||
})[]; | ||
ignores?: string[]; | ||
} | ||
@@ -16,0 +12,0 @@ |
@@ -8,7 +8,3 @@ import type { RuleConfig } from '../rule-config'; | ||
autofix?: boolean; | ||
ignore?: (string & { | ||
[k: string]: any; | ||
} & { | ||
[k: string]: any; | ||
})[]; | ||
ignore?: string[]; | ||
} | ||
@@ -15,0 +11,0 @@ |
@@ -6,4 +6,4 @@ /** | ||
*/ | ||
export type LiteralUnion<T extends U, U = string> = | ||
| T | ||
| (U & { zz_IGNORE_ME?: never }); | ||
export type LiteralUnion<Union extends Base, Base = string> = | ||
| Union | ||
| (Base & { zz_IGNORE_ME?: never }); |
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"module": "ES2020", | ||
"moduleResolution": "Node", | ||
@@ -5,0 +6,0 @@ "rootDir": ".", |
1602755
1426
49208
48