Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove now-unnecessary disable of jsdoc/lines-before-block #1701

Merged
merged 3 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ export default tseslint.config(
},
},
rules: {
// These on-by-default rules don't work well for this repo and we like them off.
"jsdoc/lines-before-block": "off",

// These on-by-default rules work well for this repo if configured
"@typescript-eslint/no-unnecessary-condition": [
"error",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"console-fail-test": "^0.5.0",
"cspell": "^8.14.2",
"eslint": "^9.9.0",
"eslint-plugin-jsdoc": "^50.5.0",
"eslint-plugin-jsdoc": "^50.6.0",
"eslint-plugin-jsonc": "^2.16.0",
"eslint-plugin-markdown": "^5.1.0",
"eslint-plugin-n": "^17.12.0",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions script/__snapshots__/migrate-test-e2e.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ exports[`expected file changes > eslint.config.js 1`] = `
},
tsconfigRootDir: import.meta.dirname,
},
@@ ... @@ export default tseslint.config(
// These on-by-default rules don't work well for this repo and we like them off.
"jsdoc/lines-before-block": "off",

},
rules: {
- // These on-by-default rules work well for this repo if configured
- "@typescript-eslint/no-unnecessary-condition": [
- "error",
Expand Down
3 changes: 0 additions & 3 deletions src/steps/writing/creation/createESLintConfig.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ describe("createESLintConfig", () => {
},
},
rules: {
// These on-by-default rules don't work well for this repo and we like them off.
"jsdoc/lines-before-block": "off",

// Stylistic concerns that don't interfere with Prettier
"logical-assignment-operators": [
"error",
Expand Down
25 changes: 7 additions & 18 deletions src/steps/writing/creation/createESLintConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,9 @@ export async function createESLintConfig(options: Options) {
!options.excludeLintRegex && ` regexp.configs["flat/recommended"],`,
].filter(Boolean);

const rules = `{
${
options.excludeLintJSDoc
? ""
: `

// These on-by-default rules don't work well for this repo and we like them off.
"jsdoc/lines-before-block": "off",`
}${
options.excludeLintStylistic
? ""
: `

const rules =
!options.excludeLintStylistic &&
`{
// Stylistic concerns that don't interfere with Prettier
"logical-assignment-operators": [
"error",
Expand All @@ -63,8 +53,7 @@ export async function createESLintConfig(options: Options) {
],
"no-useless-rename": "error",
"object-shorthand": "error",
"operator-assignment": "error",`
}
"operator-assignment": "error",
}`;

return await formatTypeScript(`${imports.join("\n")}
Expand Down Expand Up @@ -111,10 +100,10 @@ export default tseslint.config(
tsconfigRootDir: import.meta.dirname
},
},${
rules.replaceAll(/\s+/g, "") === "{}"
? ""
: `
rules
? `
rules: ${rules},`
: ""
}${
options.excludeLintPerfectionist
? ""
Expand Down