Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a150068

Browse files
authoredOct 29, 2021
BREAKING CHANGE: update eslint config to align with latest reqs (#5303)
* update eslint-config-rules and versions, fix fast-element lint errors * fix fast-router lint issues * fix foundation errors * fix figma plugin lint errors * fix react issues and disable ban types for empty object as its useful in tsx defs * Change files * temporary allow major version for eslint package add js file override to eslint config (#5310) * add js file override to eslint config * deduplicate lockfile * remove no-non-null-assertation and add noImplicitAny and strictPropertyInitialization to base tsconfig * fix new errors in web utils * turn off noImplicitAny and strictPropertyInitialization for fast-element due to errors * turn off strictPropertyAssignment and noImplicitAny for fast-foundation tsconfig * resolve certain no-non-null-assertion errors and disable others * turn off noImplicitAny and strictPropertyInitialization for fast-components * disable anchored region and palette * resolve color constants, dsp, dialog issues * turn off strictPropertyInitialization and noImplicitAny for fast-router * turn off no-non-null-assertion in eslint * turn off strictNullChecks, strictPropertyInitialization, and noImplicitAny in fast-colors * update fast-react-wrapper * Change files * fixup web utilities dom typings * fixup fast-web-utilities html spec files * disable strict null checks due to numbers, rtl, and string test and fn issues * fixup final react wrapper issues * add types specifically for the test package * fix figma plugin type issues * ignore non-null errors for color in fast-color-explorer * fix type error by casting due to implicit any
1 parent e0910d1 commit a150068

File tree

123 files changed

+838
-515
lines changed

Some content is hidden

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

123 files changed

+838
-515
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{
22
"extends": "../../../tsconfig.json",
33
"compilerOptions": {
4+
"strictNullChecks": false,
5+
"noImplicitAny": false,
6+
"strictPropertyInitialization": false,
47
"baseUrl": "."
58
}
69
}

‎packages/utilities/fast-eslint-rules/.eslintrc.js

+33-14
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,20 @@ module.exports = {
44
plugins: ["@typescript-eslint", "import"],
55
extends: [
66
"eslint:recommended",
7-
"plugin:react/recommended",
87
"plugin:@typescript-eslint/eslint-recommended",
98
"plugin:@typescript-eslint/recommended",
109
],
11-
settings: {
12-
react: {
13-
version: "latest",
14-
},
15-
},
1610
rules: {
17-
"@typescript-eslint/interface-name-prefix": ["error", { prefixWithI: "never" }],
11+
"no-unused-vars": "off",
12+
"no-extra-boolean-cast": "off",
13+
"no-empty-function": "off",
14+
"@typescript-eslint/no-empty-function": [
15+
"error",
16+
{ allow: ["asyncMethods", "methods"] },
17+
],
18+
"@typescript-eslint/no-use-before-define": "off",
19+
"@typescript-eslint/typedef": "off",
20+
"@typescript-eslint/explicit-function-return-type": "off",
1821
"max-len": ["error", 140],
1922
"import/order": "error",
2023
"sort-imports": [
@@ -25,16 +28,12 @@ module.exports = {
2528
},
2629
],
2730
"comma-dangle": "off",
28-
"@typescript-eslint/typedef": [
31+
"@typescript-eslint/no-empty-interface": [
2932
"error",
3033
{
31-
parameter: true,
32-
propertyDeclaration: true,
33-
memberVariableDeclaration: true,
34-
variableDeclarationIgnoreFunction: true,
34+
allowSingleExtends: true,
3535
},
3636
],
37-
"@typescript-eslint/explicit-function-return-type": "error",
3837
"@typescript-eslint/camelcase": "off",
3938
"@typescript-eslint/naming-convention": [
4039
"error",
@@ -53,13 +52,33 @@ module.exports = {
5352
format: null, // disable for variable names because of our foo__expanded convention for JSS
5453
// TODO: I think we can come up with a regex that ignores variables with __ in them
5554
},
55+
{
56+
selector: "interface",
57+
format: ["PascalCase"],
58+
custom: {
59+
regex: "^I[A-Z]",
60+
match: false,
61+
},
62+
},
5663
],
5764
"@typescript-eslint/no-inferrable-types": "off",
5865
"no-prototype-builtins": "off",
5966
"no-fallthrough": "off",
6067
"no-unexpected-multiline": "off",
6168
"@typescript-eslint/no-unused-vars": ["warn", { args: "none" }],
62-
"react/no-children-prop": "off",
6369
"@typescript-eslint/no-explicit-any": "off",
6470
},
71+
overrides: [
72+
{
73+
files: ["**/*.js"],
74+
extends: ["eslint:recommended"],
75+
env: {
76+
node: true,
77+
"shared-node-browser": true,
78+
},
79+
rules: {
80+
"@typescript-eslint/no-var-requires": "off",
81+
},
82+
},
83+
],
6584
};

‎packages/utilities/fast-eslint-rules/package.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@
2121
},
2222
"main": ".eslintrc.js",
2323
"homepage": "https://github.com/Microsoft/fast-eslint-rules#readme",
24+
"beachball": {
25+
"disallowedChangeTypes": []
26+
},
2427
"dependencies": {
25-
"@typescript-eslint/eslint-plugin": "^2.23.0",
26-
"@typescript-eslint/parser": "^2.23.0",
27-
"eslint": "^6.8.0",
28-
"eslint-plugin-import": "^2.20.1",
29-
"eslint-plugin-react": "^7.19.0",
30-
"typescript": "^3.9.0"
28+
"@typescript-eslint/eslint-plugin": "^5.0.0",
29+
"@typescript-eslint/parser": "^5.0.0",
30+
"eslint": "^8.0.0",
31+
"eslint-plugin-import": "^2.25.0",
32+
"typescript": "~3.9.0 || ~4.3.5"
3133
}
3234
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
module.exports = {
22
extends: ["@microsoft/eslint-config-fast-dna", "prettier"],
3-
rules: {
4-
"no-extra-boolean-cast": "off",
5-
"@typescript-eslint/no-use-before-define": "off",
6-
"@typescript-eslint/typedef": "off",
7-
"@typescript-eslint/explicit-function-return-type": "off",
8-
"@typescript-eslint/no-non-null-assertion": "off",
9-
},
103
};
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.