Skip to content

Commit 2f8bfbf

Browse files
feat!: update rule defaults
1 parent ea742df commit 2f8bfbf

9 files changed

+23
-216
lines changed

eslint.config.ts

-19
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,8 @@ import style from "./dist/index.js";
55

66
export default style(
77
{
8-
formatters: {
9-
markdown: true,
10-
prettierOptions: {
11-
arrowParens: "avoid",
12-
jsdocPreferCodeFences: true,
13-
jsdocPrintWidth: 80,
14-
plugins: ["prettier-plugin-jsdoc"],
15-
printWidth: 100,
16-
semi: true,
17-
singleQuote: false,
18-
tabWidth: 4,
19-
trailingComma: "all",
20-
tsdoc: true,
21-
useTabs: true,
22-
},
23-
toml: true,
24-
},
258
ignores: ["fixtures", "_fixtures", "src/typegen.d.ts"],
26-
react: false,
279
roblox: false,
28-
yaml: true,
2910
},
3011
{
3112
files: ["src/**/*.ts"],

package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"publishConfig": {
66
"access": "public"
77
},
8-
"packageManager": "pnpm@9.1.2",
8+
"packageManager": "pnpm@9.4.0",
99
"description": "iSentinel's ESLint config",
1010
"author": "Christopher Buss <christopher.buss@pm.me> (https://github.com/christopher-buss)",
1111
"contributors": [
@@ -57,7 +57,6 @@
5757
}
5858
},
5959
"dependencies": {
60-
"@antfu/eslint-define-config": "1.23.0-2",
6160
"@antfu/install-pkg": "^0.3.3",
6261
"@clack/prompts": "^0.7.0",
6362
"@cspell/eslint-plugin": "^8.8.4",
@@ -84,14 +83,12 @@
8483
"eslint-plugin-jsonc": "^2.16.0",
8584
"eslint-plugin-markdown": "^5.0.0",
8685
"eslint-plugin-no-autofix": "^2.0.0",
87-
"eslint-plugin-no-only-tests": "^3.1.0",
8886
"eslint-plugin-perfectionist": "^2.11.0",
8987
"eslint-plugin-prettier": "^5.1.3",
9088
"eslint-plugin-promise": "^6.2.0",
9189
"eslint-plugin-sonarjs": "^1.0.3",
9290
"eslint-plugin-toml": "^0.11.0",
9391
"eslint-plugin-unicorn": "^53.0.0",
94-
"eslint-plugin-unused-imports": "^3.2.0",
9592
"eslint-plugin-yml": "^1.14.0",
9693
"globals": "^15.4.0",
9794
"isentinel-eslint-plugin-roblox-ts": "^0.0.37",

pnpm-lock.yaml

-38
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/configs/comments.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { fixupPluginRules } from "@eslint/compat";
22

3+
import { GLOB_YAML } from "src/globs";
34
import type { TypedFlatConfigItem } from "src/types";
45

56
import { pluginCommentLength, pluginComments } from "../plugins";
@@ -13,20 +14,10 @@ export async function comments(): Promise<Array<TypedFlatConfigItem>> {
1314
"eslint-comments": pluginComments,
1415
},
1516
rules: {
16-
"comment-length/limit-multi-line-comments": [
17-
"warn",
18-
{
19-
ignoreUrls: true,
20-
maxLength: 80,
21-
},
22-
],
23-
"comment-length/limit-single-line-comments": [
24-
"warn",
25-
{
26-
ignoreUrls: true,
27-
maxLength: 80,
28-
},
29-
],
17+
// We cover these with prettier
18+
"comment-length/limit-multi-line-comments": "off",
19+
"comment-length/limit-single-line-comments": "off",
20+
3021
"eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }],
3122
"eslint-comments/no-aggregating-enable": "error",
3223
"eslint-comments/no-duplicate-disable": "error",
@@ -43,5 +34,14 @@ export async function comments(): Promise<Array<TypedFlatConfigItem>> {
4334
"style/multiline-comment-style": ["error", "separate-lines"],
4435
},
4536
},
37+
{
38+
files: [GLOB_YAML],
39+
rules: {
40+
// TODO: Seems to be a false positive
41+
"comment-length/limit-multi-line-comments": "off",
42+
43+
"no-inline-comments": "off",
44+
},
45+
},
4646
];
4747
}

src/configs/formatters.ts

+1-21
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@ export async function formatters(
1010
stylistic: StylisticConfig = {},
1111
markdownEnabled = true,
1212
): Promise<Array<TypedFlatConfigItem>> {
13-
if (options === true) {
13+
if (options === undefined || options === true) {
1414
options = {
1515
css: true,
1616
graphql: true,
1717
html: true,
1818
markdown: true,
19-
toml: true,
2019
};
2120
}
2221

@@ -126,25 +125,6 @@ export async function formatters(
126125
});
127126
}
128127

129-
if (options.toml) {
130-
configs.push({
131-
files: ["**/*.toml"],
132-
languageOptions: {
133-
parser: pluginFormat.parserPlain,
134-
},
135-
name: "style:formatter:toml",
136-
rules: {
137-
"format/dprint": [
138-
"error",
139-
{
140-
...dprintOptions,
141-
language: "toml",
142-
},
143-
],
144-
},
145-
});
146-
}
147-
148128
if (options.markdown) {
149129
const formatter = options.markdown === true ? "prettier" : options.markdown;
150130

src/configs/prettier.ts

+4
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@ export async function prettier(
2929

3030
const defaultPrettierOptions = {
3131
arrowParens: "avoid",
32+
jsdocPreferCodeFences: true,
33+
jsdocPrintWidth: 80,
34+
plugins: ["prettier-plugin-jsdoc"],
3235
printWidth: 100,
3336
semi: true,
3437
singleQuote: false,
3538
tabWidth: 4,
3639
trailingComma: "all",
40+
tsdoc: true,
3741
useTabs: true,
3842
...prettierOptions,
3943
} satisfies PrettierOptions;

src/plugins.ts

-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ export { default as pluginPromise } from "eslint-plugin-promise";
1616
export { default as pluginSimpleImportSort } from "eslint-plugin-simple-import-sort";
1717
export * as pluginSonar from "eslint-plugin-sonarjs";
1818
export { default as pluginUnicorn } from "eslint-plugin-unicorn";
19-
export { default as pluginUnusedImports } from "eslint-plugin-unused-imports";
2019
export { default as pluginRobloxTS } from "isentinel-eslint-plugin-roblox-ts";

src/typegen.d.ts

+2-77
Original file line numberDiff line numberDiff line change
@@ -3331,7 +3331,7 @@ export interface RuleOptions {
33313331
'no-autofix/@typescript-eslint/no-unused-expressions'?: Linter.RuleEntry<NoAutofixTypescriptEslintNoUnusedExpressions>
33323332
/**
33333333
* Disallow unused variables
3334-
* @see https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/no-unused-imports.md
3334+
* @see https://typescript-eslint.io/rules/no-unused-vars
33353335
*/
33363336
'no-autofix/@typescript-eslint/no-unused-vars'?: Linter.RuleEntry<NoAutofixTypescriptEslintNoUnusedVars>
33373337
/**
@@ -6519,11 +6519,6 @@ export interface RuleOptions {
65196519
* @see https://eslint.org/docs/latest/rules/no-octal-escape
65206520
*/
65216521
'no-autofix/no-octal-escape'?: Linter.RuleEntry<[]>
6522-
/**
6523-
* disallow .only blocks in tests
6524-
* @see https://github.com/levibuzolic/eslint-plugin-no-only-tests
6525-
*/
6526-
'no-autofix/no-only-tests/no-only-tests'?: Linter.RuleEntry<NoAutofixNoOnlyTestsNoOnlyTests>
65276522
/**
65286523
* Disallow reassigning `function` parameters
65296524
* @see https://eslint.org/docs/latest/rules/no-param-reassign
@@ -9287,26 +9282,6 @@ export interface RuleOptions {
92879282
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v53.0.0/docs/rules/throw-new-error.md
92889283
*/
92899284
'no-autofix/unicorn/throw-new-error'?: Linter.RuleEntry<[]>
9290-
/**
9291-
* Disallow unused variables
9292-
* @see https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/no-unused-imports.md
9293-
*/
9294-
'no-autofix/unused-imports/no-unused-imports'?: Linter.RuleEntry<NoAutofixUnusedImportsNoUnusedImports>
9295-
/**
9296-
* Disallow unused variables
9297-
* @see https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/no-unused-imports.md
9298-
*/
9299-
'no-autofix/unused-imports/no-unused-imports-ts'?: Linter.RuleEntry<NoAutofixUnusedImportsNoUnusedImportsTs>
9300-
/**
9301-
* Disallow unused variables
9302-
* @see https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/no-unused-imports.md
9303-
*/
9304-
'no-autofix/unused-imports/no-unused-vars'?: Linter.RuleEntry<NoAutofixUnusedImportsNoUnusedVars>
9305-
/**
9306-
* Disallow unused variables
9307-
* @see https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/no-unused-imports.md
9308-
*/
9309-
'no-autofix/unused-imports/no-unused-vars-ts'?: Linter.RuleEntry<NoAutofixUnusedImportsNoUnusedVarsTs>
93109285
/**
93119286
* Require calls to `isNaN()` when checking for `NaN`
93129287
* @see https://eslint.org/docs/latest/rules/use-isnan
@@ -12329,7 +12304,7 @@ export interface RuleOptions {
1232912304
'ts/no-unused-expressions'?: Linter.RuleEntry<TsNoUnusedExpressions>
1233012305
/**
1233112306
* Disallow unused variables
12332-
* @see https://github.com/sweepline/eslint-plugin-unused-imports/blob/master/docs/rules/no-unused-imports.md
12307+
* @see https://typescript-eslint.io/rules/no-unused-vars
1233312308
*/
1233412309
'ts/no-unused-vars'?: Linter.RuleEntry<TsNoUnusedVars>
1233512310
/**
@@ -21992,12 +21967,6 @@ type NoAutofixNoMultipleEmptyLines = []|[{
2199221967
type NoAutofixNoNativeReassign = []|[{
2199321968
exceptions?: string[]
2199421969
}]
21995-
// ----- no-autofix/no-only-tests/no-only-tests -----
21996-
type NoAutofixNoOnlyTestsNoOnlyTests = []|[{
21997-
block?: string[]
21998-
focus?: string[]
21999-
fix?: boolean
22000-
}]
2200121970
// ----- no-autofix/no-param-reassign -----
2200221971
type NoAutofixNoParamReassign = []|[({
2200321972
props?: false
@@ -23709,50 +23678,6 @@ type NoAutofixUnicornTemplateIndent = []|[{
2370923678
selectors?: string[]
2371023679
comments?: string[]
2371123680
}]
23712-
// ----- no-autofix/unused-imports/no-unused-imports -----
23713-
type NoAutofixUnusedImportsNoUnusedImports = []|[(("all" | "local") | {
23714-
vars?: ("all" | "local")
23715-
varsIgnorePattern?: string
23716-
args?: ("all" | "after-used" | "none")
23717-
ignoreRestSiblings?: boolean
23718-
argsIgnorePattern?: string
23719-
caughtErrors?: ("all" | "none")
23720-
caughtErrorsIgnorePattern?: string
23721-
destructuredArrayIgnorePattern?: string
23722-
})]
23723-
// ----- no-autofix/unused-imports/no-unused-imports-ts -----
23724-
type NoAutofixUnusedImportsNoUnusedImportsTs = []|[(("all" | "local") | {
23725-
vars?: ("all" | "local")
23726-
varsIgnorePattern?: string
23727-
args?: ("all" | "after-used" | "none")
23728-
ignoreRestSiblings?: boolean
23729-
argsIgnorePattern?: string
23730-
caughtErrors?: ("all" | "none")
23731-
caughtErrorsIgnorePattern?: string
23732-
destructuredArrayIgnorePattern?: string
23733-
})]
23734-
// ----- no-autofix/unused-imports/no-unused-vars -----
23735-
type NoAutofixUnusedImportsNoUnusedVars = []|[(("all" | "local") | {
23736-
vars?: ("all" | "local")
23737-
varsIgnorePattern?: string
23738-
args?: ("all" | "after-used" | "none")
23739-
ignoreRestSiblings?: boolean
23740-
argsIgnorePattern?: string
23741-
caughtErrors?: ("all" | "none")
23742-
caughtErrorsIgnorePattern?: string
23743-
destructuredArrayIgnorePattern?: string
23744-
})]
23745-
// ----- no-autofix/unused-imports/no-unused-vars-ts -----
23746-
type NoAutofixUnusedImportsNoUnusedVarsTs = []|[(("all" | "local") | {
23747-
vars?: ("all" | "local")
23748-
varsIgnorePattern?: string
23749-
args?: ("all" | "after-used" | "none")
23750-
ignoreRestSiblings?: boolean
23751-
argsIgnorePattern?: string
23752-
caughtErrors?: ("all" | "none")
23753-
caughtErrorsIgnorePattern?: string
23754-
destructuredArrayIgnorePattern?: string
23755-
})]
2375623681
// ----- no-autofix/use-isnan -----
2375723682
type NoAutofixUseIsnan = []|[{
2375823683
enforceForSwitchCase?: boolean

0 commit comments

Comments
 (0)