Skip to content

Commit 705a1c2

Browse files
committed
Improve configuration
* Remove configuration of prettier default tab width * Add markdownlint to recommended extensions * Do not ignore .d.ts files * Disable explicit any warnings * Configure unused variables rule to allow unused starting with underscore * Disable no-prototype-builtins rule * Auto detect React version * Explicitly set prettier extension as default formatter for all languages * Avoids user config for certain languages overriding a general-only setting of the formatter. * Enable formatting via prettier again. * Include files with ESLint instead of excluding them * Add prettier as root dependency * Allow empty interfaces extending other ones in core * Add lint npm scripts for vue * angular: Disable component suffix eslint rule
1 parent 55b44dc commit 705a1c2

29 files changed

+432
-244
lines changed

.prettierrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ module.exports = {
33
singleQuote: true,
44
jsxSingleQuote: true,
55
endOfLine: 'auto',
6-
tabWidth: 2,
76
}

.vscode/extensions.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
// See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
33
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
4-
54
// List of extensions which should be recommended for users of this workspace.
65
"recommendations": [
6+
"DavidAnson.vscode-markdownlint",
77
"dbaeumer.vscode-eslint",
8-
"esbenp.prettier-vscode",
9-
"ms-vscode-remote.remote-containers"
8+
"esbenp.prettier-vscode",
9+
"ms-vscode-remote.remote-containers",
1010
],
1111
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
1212
"unwantedRecommendations": []
13-
}
13+
}

.vscode/settings.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,37 @@
99
"vue"
1010
],
1111
"[javascript]": {
12+
"editor.defaultFormatter": "esbenp.prettier-vscode",
1213
"editor.codeActionsOnSave": {
1314
"source.fixAll.eslint": true
1415
},
15-
"editor.formatOnSave": false,
1616
},
1717
"[javascriptreact]": {
18+
"editor.defaultFormatter": "esbenp.prettier-vscode",
1819
"editor.codeActionsOnSave": {
1920
"source.fixAll.eslint": true
2021
},
21-
"editor.formatOnSave": false
22+
},
23+
"[json]": {
24+
"editor.defaultFormatter": "esbenp.prettier-vscode",
2225
},
2326
"[typescript]": {
27+
"editor.defaultFormatter": "esbenp.prettier-vscode",
2428
"editor.codeActionsOnSave": {
2529
"source.fixAll.eslint": true
2630
},
27-
"editor.formatOnSave": false
2831
},
2932
"[typescriptreact]": {
33+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3034
"editor.codeActionsOnSave": {
3135
"source.fixAll.eslint": true
3236
},
33-
"editor.formatOnSave": false
3437
},
3538
"[vue]": {
39+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3640
"editor.codeActionsOnSave": {
3741
"source.fixAll.eslint": true
3842
},
39-
"editor.formatOnSave": false
4043
},
4144
"search.exclude": {
4245
"**/docs": true,

package-lock.json

Lines changed: 222 additions & 201 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"lerna": "^3.19.0",
3434
"nan": "^2.14.2",
3535
"nyc": "^15.1.0",
36+
"prettier": "^2.8.4",
3637
"source-map-loader": "^0.2.4",
3738
"source-map-support": "0.5.16",
3839
"style-loader": "^1.0.1",

packages/angular-material/.eslintrc.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module.exports = {
77
/* Reset project because @angular-eslint/recommended sets this to an incompatible value */
88
project: null,
99
},
10-
ignorePatterns: ['dist', 'docs', 'lib', 'node_modules', '*.d.ts'],
10+
// There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!)
11+
ignorePatterns: ['/*', '!/src', '!/test', '!/example'],
1112
extends: [
1213
'eslint:recommended',
1314
'plugin:@typescript-eslint/recommended',
@@ -18,8 +19,20 @@ module.exports = {
1819
'plugin:prettier/recommended',
1920
],
2021
rules: {
21-
'@angular-eslint/component-class-suffix': 'warn',
22+
'@angular-eslint/component-class-suffix': 'off',
2223
'@angular-eslint/directive-class-suffix': 'warn',
2324
'@angular-eslint/no-conflicting-lifecycle': 'warn',
25+
'@typescript-eslint/no-explicit-any': 'off',
26+
'no-prototype-builtins': 'off',
27+
// Base rule must be disabled to avoid incorrect errors
28+
'no-unused-vars': 'off',
29+
'@typescript-eslint/no-unused-vars': [
30+
'warn', // or "error"
31+
{
32+
argsIgnorePattern: '^_',
33+
varsIgnorePattern: '^_',
34+
caughtErrorsIgnorePattern: '^_',
35+
},
36+
],
2437
},
2538
};

packages/angular-material/.prettierrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ module.exports = {
33
singleQuote: true,
44
jsxSingleQuote: true,
55
endOfLine: 'auto',
6-
tabWidth: 2,
76
}

packages/angular-test/.eslintrc.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module.exports = {
77
/* Reset project because @angular-eslint/recommended sets this to an incompatible value */
88
project: null,
99
},
10-
ignorePatterns: ['dist', 'docs', 'lib', 'node_modules', '*.d.ts'],
10+
// There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!)
11+
ignorePatterns: ['/*', '!/src'],
1112
extends: [
1213
'eslint:recommended',
1314
'plugin:@typescript-eslint/recommended',
@@ -18,8 +19,20 @@ module.exports = {
1819
'plugin:prettier/recommended',
1920
],
2021
rules: {
21-
'@angular-eslint/component-class-suffix': 'warn',
22+
'@angular-eslint/component-class-suffix': 'off',
2223
'@angular-eslint/directive-class-suffix': 'warn',
2324
'@angular-eslint/no-conflicting-lifecycle': 'warn',
25+
'@typescript-eslint/no-explicit-any': 'off',
26+
'no-prototype-builtins': 'off',
27+
// Base rule must be disabled to avoid incorrect errors
28+
'no-unused-vars': 'off',
29+
'@typescript-eslint/no-unused-vars': [
30+
'warn', // or "error"
31+
{
32+
argsIgnorePattern: '^_',
33+
varsIgnorePattern: '^_',
34+
caughtErrorsIgnorePattern: '^_',
35+
},
36+
],
2437
},
2538
};

packages/angular-test/.prettierrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ module.exports = {
33
singleQuote: true,
44
jsxSingleQuote: true,
55
endOfLine: 'auto',
6-
tabWidth: 2,
76
}

packages/angular/.eslintrc.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module.exports = {
77
/* Reset project because @angular-eslint/recommended sets this to an incompatible value */
88
project: null,
99
},
10-
ignorePatterns: ['dist', 'docs', 'lib', 'node_modules', '*.d.ts'],
10+
// There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!)
11+
ignorePatterns: ['/*', '!/src', '!/test'],
1112
extends: [
1213
'eslint:recommended',
1314
'plugin:@typescript-eslint/recommended',
@@ -18,8 +19,20 @@ module.exports = {
1819
'plugin:prettier/recommended',
1920
],
2021
rules: {
21-
'@angular-eslint/component-class-suffix': 'warn',
22+
'@angular-eslint/component-class-suffix': 'off',
2223
'@angular-eslint/directive-class-suffix': 'warn',
2324
'@angular-eslint/no-conflicting-lifecycle': 'warn',
25+
'@typescript-eslint/no-explicit-any': 'off',
26+
'no-prototype-builtins': 'off',
27+
// Base rule must be disabled to avoid incorrect errors
28+
'no-unused-vars': 'off',
29+
'@typescript-eslint/no-unused-vars': [
30+
'warn', // or "error"
31+
{
32+
argsIgnorePattern: '^_',
33+
varsIgnorePattern: '^_',
34+
caughtErrorsIgnorePattern: '^_',
35+
},
36+
],
2437
},
2538
};

packages/angular/.prettierrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ module.exports = {
33
singleQuote: true,
44
jsxSingleQuote: true,
55
endOfLine: 'auto',
6-
tabWidth: 2,
76
}

packages/core/.eslintrc.js

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,33 @@
33
module.exports = {
44
root: true,
55
parser: '@typescript-eslint/parser',
6-
ignorePatterns: [
7-
'dist',
8-
'docs',
9-
'lib',
10-
'node_modules',
11-
'*.d.ts',
12-
'src/models/jsonSchema*',
13-
],
6+
// There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!)
7+
ignorePatterns: ['/*', '!/src', '!/test'],
148
extends: [
159
'eslint:recommended',
1610
'plugin:@typescript-eslint/recommended',
1711
'plugin:import/recommended',
1812
'plugin:import/typescript',
1913
'plugin:prettier/recommended',
2014
],
15+
rules: {
16+
'@typescript-eslint/no-empty-interface': [
17+
'error',
18+
{
19+
allowSingleExtends: true,
20+
},
21+
],
22+
'@typescript-eslint/no-explicit-any': 'off',
23+
'no-prototype-builtins': 'off',
24+
// Base rule must be disabled to avoid incorrect errors
25+
'no-unused-vars': 'off',
26+
'@typescript-eslint/no-unused-vars': [
27+
'error',
28+
{
29+
argsIgnorePattern: '^_',
30+
varsIgnorePattern: '^_',
31+
caughtErrorsIgnorePattern: '^_',
32+
},
33+
],
34+
},
2135
};

packages/core/.prettierrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ module.exports = {
33
singleQuote: true,
44
jsxSingleQuote: true,
55
endOfLine: 'auto',
6-
tabWidth: 2,
7-
}
6+
};

packages/examples-react/.eslintrc.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ module.exports = {
88
jsx: true,
99
},
1010
},
11-
ignorePatterns: ['dist', 'docs', 'lib', 'node_modules', '*.d.ts'],
11+
// There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!)
12+
ignorePatterns: ['/*', '!/src'],
1213
extends: [
1314
'eslint:recommended',
1415
'plugin:@typescript-eslint/recommended',
@@ -17,4 +18,23 @@ module.exports = {
1718
'plugin:react/recommended',
1819
'plugin:prettier/recommended',
1920
],
21+
rules: {
22+
'@typescript-eslint/no-explicit-any': 'off',
23+
'no-prototype-builtins': 'off',
24+
// Base rule must be disabled to avoid incorrect errors
25+
'no-unused-vars': 'off',
26+
'@typescript-eslint/no-unused-vars': [
27+
'warn', // or "error"
28+
{
29+
argsIgnorePattern: '^_',
30+
varsIgnorePattern: '^_',
31+
caughtErrorsIgnorePattern: '^_',
32+
},
33+
],
34+
},
35+
settings: {
36+
react: {
37+
version: 'detect',
38+
},
39+
},
2040
};

packages/examples-react/.prettierrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ module.exports = {
33
singleQuote: true,
44
jsxSingleQuote: true,
55
endOfLine: 'auto',
6-
tabWidth: 2,
76
}

packages/examples/.eslintrc.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,27 @@
33
module.exports = {
44
root: true,
55
parser: '@typescript-eslint/parser',
6-
ignorePatterns: ['dist', 'docs', 'lib', 'node_modules', '*.d.ts'],
6+
// There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!)
7+
ignorePatterns: ['/*', '!/src'],
78
extends: [
89
'eslint:recommended',
910
'plugin:@typescript-eslint/recommended',
1011
'plugin:import/recommended',
1112
'plugin:import/typescript',
1213
'plugin:prettier/recommended',
1314
],
15+
rules: {
16+
'@typescript-eslint/no-explicit-any': 'off',
17+
'no-prototype-builtins': 'off',
18+
// Base rule must be disabled to avoid incorrect errors
19+
'no-unused-vars': 'off',
20+
'@typescript-eslint/no-unused-vars': [
21+
'warn', // or "error"
22+
{
23+
argsIgnorePattern: '^_',
24+
varsIgnorePattern: '^_',
25+
caughtErrorsIgnorePattern: '^_',
26+
},
27+
],
28+
},
1429
};

packages/examples/.prettierrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ module.exports = {
33
singleQuote: true,
44
jsxSingleQuote: true,
55
endOfLine: 'auto',
6-
tabWidth: 2,
76
}

packages/material-renderers/.eslintrc.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ module.exports = {
88
jsx: true,
99
},
1010
},
11-
ignorePatterns: ['dist', 'docs', 'lib', 'node_modules', '*.d.ts'],
11+
// There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!)
12+
ignorePatterns: ['/*', '!/src', '!/test', '!/example'],
1213
extends: [
1314
'eslint:recommended',
1415
'plugin:@typescript-eslint/recommended',
@@ -17,4 +18,23 @@ module.exports = {
1718
'plugin:react/recommended',
1819
'plugin:prettier/recommended',
1920
],
21+
rules: {
22+
'@typescript-eslint/no-explicit-any': 'off',
23+
'no-prototype-builtins': 'off',
24+
// Base rule must be disabled to avoid incorrect errors
25+
'no-unused-vars': 'off',
26+
'@typescript-eslint/no-unused-vars': [
27+
'warn', // or "error"
28+
{
29+
argsIgnorePattern: '^_',
30+
varsIgnorePattern: '^_',
31+
caughtErrorsIgnorePattern: '^_',
32+
},
33+
],
34+
},
35+
settings: {
36+
react: {
37+
version: 'detect',
38+
},
39+
},
2040
};

packages/material-renderers/.prettierrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ module.exports = {
33
singleQuote: true,
44
jsxSingleQuote: true,
55
endOfLine: 'auto',
6-
tabWidth: 2,
76
}

packages/react/.eslintrc.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ module.exports = {
88
jsx: true,
99
},
1010
},
11-
ignorePatterns: ['dist', 'docs', 'lib', 'node_modules', '*.d.ts'],
11+
// There is no file include in ESLint. Thus, ignore all and include files via negative ignore (!)
12+
ignorePatterns: ['/*', '!/src', '!/test'],
1213
extends: [
1314
'eslint:recommended',
1415
'plugin:@typescript-eslint/recommended',
@@ -17,4 +18,23 @@ module.exports = {
1718
'plugin:react/recommended',
1819
'plugin:prettier/recommended',
1920
],
21+
rules: {
22+
'@typescript-eslint/no-explicit-any': 'off',
23+
'no-prototype-builtins': 'off',
24+
// Base rule must be disabled to avoid incorrect errors
25+
'no-unused-vars': 'off',
26+
'@typescript-eslint/no-unused-vars': [
27+
'warn', // or "error"
28+
{
29+
argsIgnorePattern: '^_',
30+
varsIgnorePattern: '^_',
31+
caughtErrorsIgnorePattern: '^_',
32+
},
33+
],
34+
},
35+
settings: {
36+
react: {
37+
version: 'detect',
38+
},
39+
},
2040
};

0 commit comments

Comments
 (0)