Skip to content

Commit 579d24b

Browse files
committed
Refactors ESLint rules for BatchExplorer
Also disallows "fdescribe" and "fit" to avoid leaving focused tests in builds.
1 parent 7792a79 commit 579d24b

3 files changed

Lines changed: 56 additions & 53 deletions

File tree

desktop/.eslintrc.desktop.json

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,45 @@
22
"extends": [
33
"../util/common-config/.eslintrc-common.json"
44
],
5+
"plugins": [
6+
"@angular-eslint/eslint-plugin",
7+
"@angular-eslint/eslint-plugin-template",
8+
"@typescript-eslint"
9+
],
510
"rules": {
611
"@typescript-eslint/ban-types": "off",
712
"@typescript-eslint/explicit-module-boundary-types": "off",
813
"@typescript-eslint/no-explicit-any": "off",
914
"no-case-declarations": "off",
1015
"no-extra-boolean-cast": "off",
11-
"no-useless-escape": "off"
16+
"no-useless-escape": "off",
17+
"@angular-eslint/component-selector": [
18+
"error",
19+
{
20+
"type": "element",
21+
"prefix": [
22+
"bl",
23+
"be"
24+
],
25+
"style": "kebab-case"
26+
}
27+
],
28+
"@angular-eslint/directive-selector": [
29+
"error",
30+
{
31+
"type": "attribute",
32+
"prefix": [
33+
"bl",
34+
"be"
35+
],
36+
"style": "camelCase"
37+
}
38+
],
39+
"@angular-eslint/no-forward-ref": "off",
40+
"@angular-eslint/no-input-rename": "warn",
41+
"@angular-eslint/use-lifecycle-interface": "warn",
42+
"@typescript-eslint/no-var-requires": "warn",
43+
"@typescript-eslint/no-empty-interface": "warn",
44+
"@typescript-eslint/ban-ts-comment": "warn"
1245
}
1346
}

desktop/.eslintrc.js

Lines changed: 11 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,21 @@
11
module.exports = {
22
ignorePatterns: [
33
"node_modules/**/*",
4-
"**/node_modules/**/*",
5-
"lib/**/*",
6-
"build/**/*",
7-
"python/**/*",
8-
"docs/**/*",
9-
"data/**/*"
4+
"/lib/**/*",
5+
"/build/**/*",
6+
"/python/**/*",
7+
"/docs/**/*",
8+
"/data/**/*"
109
],
1110
env: {
1211
browser: true,
1312
es6: true,
1413
node: true
1514
},
15+
extends: [
16+
".eslintrc.desktop.json"
17+
],
1618
overrides: [
17-
/*
18-
* TYPESCRIPT FILES
19-
*/
20-
{
21-
files: ["src/**/*.ts"],
22-
extends: [
23-
".eslintrc.desktop.json",
24-
"prettier"
25-
],
26-
plugins: [
27-
"@angular-eslint/eslint-plugin",
28-
"@angular-eslint/eslint-plugin-template",
29-
"@typescript-eslint"
30-
],
31-
rules: {
32-
"@angular-eslint/component-selector": [
33-
"error",
34-
{
35-
type: "element",
36-
prefix: ["bl", "be"],
37-
style: "kebab-case"
38-
}
39-
],
40-
"@angular-eslint/directive-selector": [
41-
"error",
42-
{
43-
type: "attribute",
44-
prefix: ["bl", "be"],
45-
style: "camelCase"
46-
}
47-
],
48-
"@angular-eslint/no-forward-ref": "off",
49-
"@angular-eslint/no-input-rename": "warn",
50-
"@angular-eslint/use-lifecycle-interface": "warn",
51-
"@typescript-eslint/no-var-requires": "warn",
52-
"@typescript-eslint/no-empty-interface": "warn",
53-
"@typescript-eslint/ban-ts-comment": "warn"
54-
}
55-
},
5619
/*
5720
* COMPONENT TEMPLATES
5821
*/
@@ -95,10 +58,6 @@ module.exports = {
9558
*/
9659
{
9760
files: ["scripts/**/*.ts", "config/**/*.ts"],
98-
extends: [
99-
".eslintrc.desktop.json",
100-
"prettier"
101-
],
10261
parserOptions: {
10362
project: [
10463
"tsconfig.eslint.json"
@@ -119,10 +78,10 @@ module.exports = {
11978
"config/**/*.js",
12079
"test/client/**/*.js",
12180
"test/spectron/run.js",
122-
"karma.conf.js"],
81+
"karma.conf.js"
82+
],
12383
extends: [
124-
"eslint:recommended",
125-
"prettier"
84+
"eslint:recommended"
12685
],
12786
rules: {
12887
"@typescript-eslint/no-var-requires": "off",

util/common-config/.eslintrc-common.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,17 @@
4343
"checkLoops": false
4444
}
4545
],
46+
"no-restricted-globals": [
47+
"error",
48+
{
49+
"name": "fdescribe",
50+
"message": "Do not commit focused unit test suites"
51+
},
52+
{
53+
"name": "fit",
54+
"message": "Do not commit focused unit tests"
55+
}
56+
],
4657
"no-restricted-imports": [
4758
"error",
4859
{

0 commit comments

Comments
 (0)