Skip to content

Commit 47c68ae

Browse files
committed
Remove eslint rules covered by dprint
1 parent d22c324 commit 47c68ae

11 files changed

+2
-790
lines changed

.eslintrc.json

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
"@typescript-eslint/array-type": "error",
3333
"@typescript-eslint/no-array-constructor": "error",
3434

35-
"brace-style": "off",
36-
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
37-
3835
"@typescript-eslint/naming-convention": [
3936
"error",
4037
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
@@ -51,58 +48,33 @@
5148
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
5249
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
5350

54-
"max-statements-per-line": ["error", { "max": 1 }],
55-
56-
"no-duplicate-imports": "off",
5751
"@typescript-eslint/no-duplicate-imports": "error",
5852

5953
"@typescript-eslint/no-inferrable-types": "error",
6054
"@typescript-eslint/no-misused-new": "error",
6155
"@typescript-eslint/no-this-alias": "error",
6256

63-
"no-unused-expressions": "off",
6457
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],
6558

6659
"@typescript-eslint/prefer-for-of": "error",
6760
"@typescript-eslint/prefer-function-type": "error",
6861
"@typescript-eslint/prefer-namespace-keyword": "error",
6962
"@typescript-eslint/prefer-as-const": "error",
7063

71-
"quotes": "off",
72-
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
73-
74-
"semi": "off",
75-
"@typescript-eslint/semi": "error",
76-
"@typescript-eslint/no-extra-semi": "error",
77-
78-
"space-before-function-paren": "off",
79-
"@typescript-eslint/space-before-function-paren": ["error", {
80-
"asyncArrow": "always",
81-
"anonymous": "always",
82-
"named": "never"
83-
}],
84-
8564
"@typescript-eslint/triple-slash-reference": "error",
86-
"@typescript-eslint/type-annotation-spacing": "error",
8765
"@typescript-eslint/unified-signatures": "error",
8866

8967
"@typescript-eslint/no-extra-non-null-assertion": "error",
9068

91-
// TODO(jakebailey): remove this and other formatting related rules once dprint is enabled.
92-
"@typescript-eslint/comma-dangle": ["error", "always-multiline"],
93-
9469
// scripts/eslint/rules
95-
"local/object-literal-surrounding-space": "error",
96-
"local/no-type-assertion-whitespace": "error",
97-
"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",
9872
"local/only-arrow-functions": ["error", {
9973
"allowNamedFunctions": true ,
10074
"allowDeclarations": true
10175
}],
102-
"local/no-double-space": "error",
10376
"local/argument-trivia": "error",
10477
"local/no-in-operator": "error",
105-
"local/simple-indent": "error",
10678
"local/debug-assert": "error",
10779
"local/no-keywords": "error",
10880
"local/jsdoc-format": "error",
@@ -115,11 +87,9 @@
11587

11688
// eslint
11789
"constructor-super": "error",
118-
"curly": ["error", "multi-line"],
11990
"dot-notation": "error",
12091
"eqeqeq": "error",
12192
"linebreak-style": ["error", "windows"],
122-
"new-parens": "error",
12393
"no-caller": "error",
12494
"no-duplicate-case": "error",
12595
"no-empty": "error",
@@ -140,7 +110,6 @@
140110
"no-sparse-arrays": "error",
141111
"no-template-curly-in-string": "error",
142112
"no-throw-literal": "error",
143-
"no-trailing-spaces": "error",
144113
"no-undef-init": "error",
145114
"no-unsafe-finally": "error",
146115
"no-unused-labels": "error",
@@ -149,7 +118,6 @@
149118
"prefer-const": "error",
150119
"prefer-object-spread": "error",
151120
"quote-props": ["error", "consistent-as-needed"],
152-
"space-in-parens": "error",
153121
"unicode-bom": ["error", "never"],
154122
"use-isnan": "error",
155123
"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)