Skip to content

Commit c7dda15

Browse files
committed
Remove eslint rules covered by dprint
1 parent 819236f commit c7dda15

10 files changed

+2
-795
lines changed

.eslintrc.json

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,10 @@
2828
"/coverage/**"
2929
],
3030
"rules": {
31-
"sort-imports": ["error", {
32-
"ignoreCase": true,
33-
"ignoreDeclarationSort": true,
34-
"allowSeparatedGroups": true
35-
}],
36-
3731
"@typescript-eslint/adjacent-overload-signatures": "error",
3832
"@typescript-eslint/array-type": "error",
3933
"@typescript-eslint/no-array-constructor": "error",
4034

41-
"brace-style": "off",
42-
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
43-
4435
"@typescript-eslint/naming-convention": [
4536
"error",
4637
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
@@ -57,58 +48,33 @@
5748
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
5849
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
5950

60-
"max-statements-per-line": ["error", { "max": 1 }],
61-
62-
"no-duplicate-imports": "off",
6351
"@typescript-eslint/no-duplicate-imports": "error",
6452

6553
"@typescript-eslint/no-inferrable-types": "error",
6654
"@typescript-eslint/no-misused-new": "error",
6755
"@typescript-eslint/no-this-alias": "error",
6856

69-
"no-unused-expressions": "off",
7057
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],
7158

7259
"@typescript-eslint/prefer-for-of": "error",
7360
"@typescript-eslint/prefer-function-type": "error",
7461
"@typescript-eslint/prefer-namespace-keyword": "error",
7562
"@typescript-eslint/prefer-as-const": "error",
7663

77-
"quotes": "off",
78-
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
79-
80-
"semi": "off",
81-
"@typescript-eslint/semi": "error",
82-
"@typescript-eslint/no-extra-semi": "error",
83-
84-
"space-before-function-paren": "off",
85-
"@typescript-eslint/space-before-function-paren": ["error", {
86-
"asyncArrow": "always",
87-
"anonymous": "always",
88-
"named": "never"
89-
}],
90-
9164
"@typescript-eslint/triple-slash-reference": "error",
92-
"@typescript-eslint/type-annotation-spacing": "error",
9365
"@typescript-eslint/unified-signatures": "error",
9466

9567
"@typescript-eslint/no-extra-non-null-assertion": "error",
9668

97-
// TODO(jakebailey): remove this and other formatting related rules once dprint is enabled.
98-
"@typescript-eslint/comma-dangle": ["error", "always-multiline"],
99-
10069
// scripts/eslint/rules
101-
"local/object-literal-surrounding-space": "error",
102-
"local/no-type-assertion-whitespace": "error",
103-
"local/type-operator-spacing": "error",
70+
// TODO(jakebailey): no-double-space covers formatting of code that dprint handles, but also reads the text in comments.
71+
"local/no-double-space": "error",
10472
"local/only-arrow-functions": ["error", {
10573
"allowNamedFunctions": true,
10674
"allowDeclarations": true
10775
}],
108-
"local/no-double-space": "error",
10976
"local/boolean-trivia": "error",
11077
"local/no-in-operator": "error",
111-
"local/simple-indent": "error",
11278
"local/debug-assert": "error",
11379
"local/no-keywords": "error",
11480
"local/jsdoc-format": "error",
@@ -121,11 +87,9 @@
12187

12288
// eslint
12389
"constructor-super": "error",
124-
"curly": ["error", "multi-line"],
12590
"dot-notation": "error",
12691
"eqeqeq": "error",
12792
"linebreak-style": ["error", "windows"],
128-
"new-parens": "error",
12993
"no-caller": "error",
13094
"no-duplicate-case": "error",
13195
"no-empty": "error",
@@ -139,7 +103,6 @@
139103
"no-sparse-arrays": "error",
140104
"no-template-curly-in-string": "error",
141105
"no-throw-literal": "error",
142-
"no-trailing-spaces": "error",
143106
"no-undef-init": "error",
144107
"no-unsafe-finally": "error",
145108
"no-unused-labels": "error",
@@ -148,7 +111,6 @@
148111
"prefer-const": "error",
149112
"prefer-object-spread": "error",
150113
"quote-props": ["error", "consistent-as-needed"],
151-
"space-in-parens": "error",
152114
"unicode-bom": ["error", "never"],
153115
"use-isnan": "error",
154116
"no-prototype-builtins": "error",

scripts/eslint/rules/jsdoc-format.cjs

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ module.exports = createRule({
1313
internalCommentNotLastError: `@internal should only appear in final JSDoc comment for declaration.`,
1414
multipleJSDocError: `Declaration has multiple JSDoc comments.`,
1515
internalCommentOnParameterProperty: `@internal cannot appear on a JSDoc comment; use a declared property and an assignment in the constructor instead.`,
16-
misalignedJSDocComment: `This JSDoc comment is misaligned.`,
1716
},
1817
schema: [],
1918
type: "problem",
@@ -93,67 +92,7 @@ module.exports = createRule({
9392
}
9493
};
9594

96-
/** @type {(node: TSESTree.Node) => void} */
97-
const checkProgram = () => {
98-
const comments = sourceCode.getAllComments();
99-
100-
for (const c of comments) {
101-
if (c.type !== "Block") {
102-
continue;
103-
}
104-
105-
const rawComment = sourceCode.getText(c);
106-
if (!isJSDocText(rawComment)) {
107-
continue;
108-
}
109-
110-
const expected = c.loc.start.column + 2;
111-
const split = rawComment.split(/\r?\n/g);
112-
for (let i = 1; i < split.length; i++) {
113-
const line = split[i];
114-
const match = /^ *\*/.exec(line);
115-
if (!match) {
116-
continue;
117-
}
118-
119-
const actual = match[0].length;
120-
const diff = actual - expected;
121-
if (diff !== 0) {
122-
const line = c.loc.start.line + i;
123-
context.report({
124-
messageId: "misalignedJSDocComment",
125-
node: c,
126-
loc: {
127-
start: {
128-
line,
129-
column: 0,
130-
},
131-
end: {
132-
line,
133-
column: actual - 1,
134-
},
135-
},
136-
fix: fixer => {
137-
if (diff > 0) {
138-
// Too many
139-
const start = sourceCode.getIndexFromLoc({ line, column: expected - 1 });
140-
return fixer.removeRange([start, start + diff]);
141-
}
142-
else {
143-
// Too few
144-
const start = sourceCode.getIndexFromLoc({ line, column: 0 });
145-
return fixer.insertTextAfterRange([start, start], " ".repeat(-diff));
146-
}
147-
},
148-
});
149-
break;
150-
}
151-
}
152-
}
153-
};
154-
15595
return {
156-
Program: checkProgram,
15796
ClassDeclaration: checkDeclaration,
15897
FunctionDeclaration: checkDeclaration,
15998
TSEnumDeclaration: checkDeclaration,

scripts/eslint/rules/no-type-assertion-whitespace.cjs

Lines changed: 0 additions & 43 deletions
This file was deleted.

scripts/eslint/rules/object-literal-surrounding-space.cjs

Lines changed: 0 additions & 72 deletions
This file was deleted.

scripts/eslint/rules/simple-indent.cjs

Lines changed: 0 additions & 69 deletions
This file was deleted.

0 commit comments

Comments
 (0)