Skip to content

Commit 9551e67

Browse files
committed
Merge branch 'main' into noAssignabilityErrorsOnExcessProperty
# Conflicts: # tests/baselines/reference/jsxSpreadTag.js # tests/baselines/reference/jsxSpreadTag.symbols # tests/baselines/reference/jsxSpreadTag.types # tests/cases/compiler/jsxSpreadTag.ts
2 parents f180889 + 9b4aa36 commit 9551e67

File tree

279 files changed

+6603
-2611
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+6603
-2611
lines changed

.eslintrc.json

Lines changed: 91 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
"node": true,
1111
"es6": true
1212
},
13+
"extends": [
14+
"eslint:recommended",
15+
"plugin:@typescript-eslint/recommended",
16+
"plugin:@typescript-eslint/stylistic"
17+
],
1318
"plugins": [
14-
"@typescript-eslint", "no-null", "import", "eslint-plugin-local", "simple-import-sort"
19+
"@typescript-eslint", "no-null", "eslint-plugin-local", "simple-import-sort"
1520
],
1621
"ignorePatterns": [
1722
"**/node_modules/**",
@@ -25,16 +30,42 @@
2530
"/coverage/**"
2631
],
2732
"rules": {
28-
"simple-import-sort/imports": "error",
29-
"simple-import-sort/exports": "error",
30-
31-
"@typescript-eslint/adjacent-overload-signatures": "error",
32-
"@typescript-eslint/array-type": "error",
33-
"@typescript-eslint/no-array-constructor": "error",
33+
// eslint
34+
"dot-notation": "error",
35+
"eqeqeq": "error",
36+
"no-caller": "error",
37+
"no-constant-condition": ["error", { "checkLoops": false }],
38+
"no-eval": "error",
39+
"no-extra-bind": "error",
40+
"no-new-func": "error",
41+
"no-new-wrappers": "error",
42+
"no-return-await": "error",
43+
"no-restricted-globals": [
44+
"error",
45+
{ "name": "setTimeout" },
46+
{ "name": "clearTimeout" },
47+
{ "name": "setInterval" },
48+
{ "name": "clearInterval" },
49+
{ "name": "setImmediate" },
50+
{ "name": "clearImmediate" }
51+
],
52+
"no-template-curly-in-string": "error",
53+
"no-throw-literal": "error",
54+
"no-undef-init": "error",
55+
"no-var": "error",
56+
"object-shorthand": "error",
57+
"prefer-const": "error",
58+
"prefer-object-spread": "error",
59+
"unicode-bom": ["error", "never"],
3460

35-
"brace-style": "off",
36-
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
61+
// Enabled in eslint:recommended, but not applicable here
62+
"no-extra-boolean-cast": "off",
63+
"no-case-declarations": "off",
64+
"no-cond-assign": "off",
65+
"no-control-regex": "off",
66+
"no-inner-declarations": "off",
3767

68+
// @typescript-eslint/eslint-plugin
3869
"@typescript-eslint/naming-convention": [
3970
"error",
4071
{ "selector": "typeLike", "format": ["PascalCase"], "filter": { "regex": "^(__String|[A-Za-z]+_[A-Za-z]+)$", "match": false } },
@@ -48,110 +79,74 @@
4879
{ "selector": "property", "format": null }
4980
],
5081

51-
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
52-
"@typescript-eslint/consistent-type-assertions": ["error", { "assertionStyle": "as" }],
53-
54-
"max-statements-per-line": ["error", { "max": 1 }],
55-
56-
"no-duplicate-imports": "off",
57-
"@typescript-eslint/no-duplicate-imports": "error",
58-
59-
"@typescript-eslint/no-inferrable-types": "error",
60-
"@typescript-eslint/no-misused-new": "error",
61-
"@typescript-eslint/no-this-alias": "error",
62-
63-
"no-unused-expressions": "off",
64-
"@typescript-eslint/no-unused-expressions": ["error", { "allowTernary": true }],
65-
66-
"@typescript-eslint/prefer-for-of": "error",
67-
"@typescript-eslint/prefer-function-type": "error",
68-
"@typescript-eslint/prefer-namespace-keyword": "error",
69-
"@typescript-eslint/prefer-as-const": "error",
70-
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-
85-
"@typescript-eslint/triple-slash-reference": "error",
86-
"@typescript-eslint/type-annotation-spacing": "error",
87-
"@typescript-eslint/unified-signatures": "error",
88-
89-
"@typescript-eslint/no-extra-non-null-assertion": "error",
82+
// Rules enabled in typescript-eslint configs that are not applicable here
83+
"@typescript-eslint/ban-ts-comment": "off",
84+
"@typescript-eslint/class-literal-property-style": "off",
85+
"@typescript-eslint/consistent-indexed-object-style": "off",
86+
"@typescript-eslint/no-duplicate-enum-values": "off",
87+
"@typescript-eslint/no-namespace": "off",
88+
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
89+
"@typescript-eslint/no-var-requires": "off",
90+
"@typescript-eslint/no-empty-interface": "off",
91+
"@typescript-eslint/no-explicit-any": "off",
92+
93+
// Todo: For each of these, investigate whether we want to enable them ✨
94+
"@typescript-eslint/ban-types": "off",
95+
"no-useless-escape": "off",
96+
"prefer-rest-params": "off",
97+
"prefer-spread": "off",
98+
"@typescript-eslint/no-empty-function": "off",
99+
"@typescript-eslint/no-unused-vars": "off",
100+
101+
// Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820
102+
"@typescript-eslint/prefer-optional-chain": "off",
90103

91104
// scripts/eslint/rules
92-
"local/object-literal-surrounding-space": "error",
93-
"local/no-type-assertion-whitespace": "error",
94-
"local/type-operator-spacing": "error",
95-
"local/only-arrow-functions": ["error", {
96-
"allowNamedFunctions": true ,
97-
"allowDeclarations": true
98-
}],
99-
"local/no-double-space": "error",
105+
"local/only-arrow-functions": [
106+
"error",
107+
{
108+
"allowNamedFunctions": true ,
109+
"allowDeclarations": true
110+
}
111+
],
100112
"local/argument-trivia": "error",
101113
"local/no-in-operator": "error",
102-
"local/simple-indent": "error",
103114
"local/debug-assert": "error",
104115
"local/no-keywords": "error",
105116
"local/jsdoc-format": "error",
106117

107-
// eslint-plugin-import
108-
"import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
109-
110118
// eslint-plugin-no-null
111119
"no-null/no-null": "error",
112120

113-
// eslint
114-
"constructor-super": "error",
121+
// eslint-plugin-simple-import-sort
122+
"simple-import-sort/imports": "error",
123+
"simple-import-sort/exports": "error",
124+
125+
// Formatting rules; remove once a formatter enforces these.
115126
"curly": ["error", "multi-line"],
116-
"dot-notation": "error",
117-
"eqeqeq": "error",
118127
"linebreak-style": ["error", "windows"],
128+
"max-statements-per-line": ["error", { "max": 1 }],
119129
"new-parens": "error",
120-
"no-caller": "error",
121-
"no-duplicate-case": "error",
122-
"no-empty": "error",
123-
"no-eval": "error",
124-
"no-extra-bind": "error",
125-
"no-fallthrough": "error",
126-
"no-new-func": "error",
127-
"no-new-wrappers": "error",
128-
"no-return-await": "error",
129-
"no-restricted-globals": ["error",
130-
{ "name": "setTimeout" },
131-
{ "name": "clearTimeout" },
132-
{ "name": "setInterval" },
133-
{ "name": "clearInterval" },
134-
{ "name": "setImmediate" },
135-
{ "name": "clearImmediate" }
136-
],
137-
"no-sparse-arrays": "error",
138-
"no-template-curly-in-string": "error",
139-
"no-throw-literal": "error",
140130
"no-trailing-spaces": "error",
141-
"no-undef-init": "error",
142-
"no-unsafe-finally": "error",
143-
"no-unused-labels": "error",
144-
"no-var": "error",
145-
"object-shorthand": "error",
146-
"prefer-const": "error",
147-
"prefer-object-spread": "error",
148131
"quote-props": ["error", "consistent-as-needed"],
149132
"space-in-parens": "error",
150-
"unicode-bom": ["error", "never"],
151-
"use-isnan": "error",
152-
"no-prototype-builtins": "error",
153-
"no-self-assign": "error",
154-
"no-dupe-else-if": "error"
133+
"@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
134+
"@typescript-eslint/no-extra-semi": "error",
135+
"@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
136+
"@typescript-eslint/semi": "error",
137+
"@typescript-eslint/space-before-function-paren": [
138+
"error",
139+
{
140+
"asyncArrow": "always",
141+
"anonymous": "always",
142+
"named": "never"
143+
}
144+
],
145+
"local/object-literal-surrounding-space": "error",
146+
"local/no-type-assertion-whitespace": "error",
147+
"local/type-operator-spacing": "error",
148+
"local/no-double-space": "error",
149+
"local/simple-indent": "error"
155150
},
156151
"overrides": [
157152
// By default, the ESLint CLI only looks at .js files. But, it will also look at

.github/workflows/pr-modified-files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ jobs:
9999
MESSAGE+=" You can [read more here](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md#contributing-libdts-fixes)."
100100
MESSAGE+=" For house-keeping purposes, this pull request will be closed."
101101
102-
gh pr close $issue --repo ${{ github.repository }} --comment "$MESSAGE"
102+
gh pr close ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --comment "$MESSAGE"
103103
exit 1 # Stop the pipeline; we just closed the PR.
104104
fi
105105

0 commit comments

Comments
 (0)