Skip to content

Commit b81a0b3

Browse files
committed
Remove eslint rules covered by dprint
1 parent 266502c commit b81a0b3

11 files changed

+2
-790
lines changed

.eslintrc.json

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
"@typescript-eslint/array-type": "error",
3737
"@typescript-eslint/no-array-constructor": "error",
3838

39-
"brace-style": "off",
40-
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
41-
4239
"@typescript-eslint/naming-convention": [
4340
"error",
4441
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
@@ -55,58 +52,33 @@
5552
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
5653
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
5754

58-
"max-statements-per-line": ["error", { "max": 1 }],
59-
60-
"no-duplicate-imports": "off",
6155
"@typescript-eslint/no-duplicate-imports": "error",
6256

6357
"@typescript-eslint/no-inferrable-types": "error",
6458
"@typescript-eslint/no-misused-new": "error",
6559
"@typescript-eslint/no-this-alias": "error",
6660

67-
"no-unused-expressions": "off",
6861
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],
6962

7063
"@typescript-eslint/prefer-for-of": "error",
7164
"@typescript-eslint/prefer-function-type": "error",
7265
"@typescript-eslint/prefer-namespace-keyword": "error",
7366
"@typescript-eslint/prefer-as-const": "error",
7467

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

9371
"@typescript-eslint/no-extra-non-null-assertion": "error",
9472

95-
// TODO(jakebailey): remove this and other formatting related rules once dprint is enabled.
96-
"@typescript-eslint/comma-dangle": ["error", "always-multiline"],
97-
9873
// scripts/eslint/rules
99-
"local/object-literal-surrounding-space": "error",
100-
"local/no-type-assertion-whitespace": "error",
101-
"local/type-operator-spacing": "error",
74+
// TODO(jakebailey): no-double-space covers formatting of code that dprint handles, but also reads the text in comments.
75+
"local/no-double-space": "error",
10276
"local/only-arrow-functions": ["error", {
10377
"allowNamedFunctions": true,
10478
"allowDeclarations": true
10579
}],
106-
"local/no-double-space": "error",
10780
"local/argument-trivia": "error",
10881
"local/no-in-operator": "error",
109-
"local/simple-indent": "error",
11082
"local/debug-assert": "error",
11183
"local/no-keywords": "error",
11284
"local/jsdoc-format": "error",
@@ -119,11 +91,9 @@
11991

12092
// eslint
12193
"constructor-super": "error",
122-
"curly": ["error", "multi-line"],
12394
"dot-notation": "error",
12495
"eqeqeq": "error",
12596
"linebreak-style": ["error", "windows"],
126-
"new-parens": "error",
12797
"no-caller": "error",
12898
"no-duplicate-case": "error",
12999
"no-empty": "error",
@@ -137,7 +107,6 @@
137107
"no-sparse-arrays": "error",
138108
"no-template-curly-in-string": "error",
139109
"no-throw-literal": "error",
140-
"no-trailing-spaces": "error",
141110
"no-undef-init": "error",
142111
"no-unsafe-finally": "error",
143112
"no-unused-labels": "error",
@@ -146,7 +115,6 @@
146115
"prefer-const": "error",
147116
"prefer-object-spread": "error",
148117
"quote-props": ["error", "consistent-as-needed"],
149-
"space-in-parens": "error",
150118
"unicode-bom": ["error", "never"],
151119
"use-isnan": "error",
152120
"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)