Skip to content

Commit 6818325

Browse files
authored
Merge pull request #261 from dscho/more-eslint
ci: run ESLint
2 parents 398e7d6 + a03fddb commit 6818325

File tree

4 files changed

+409
-20
lines changed

4 files changed

+409
-20
lines changed

.eslintrc.json

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
{
2-
"plugins": ["jest", "@typescript-eslint"],
2+
"env": {
3+
"es6": true,
4+
"jest": true,
5+
"jest/globals": true,
6+
"node": true
7+
},
38
"extends": ["plugin:github/recommended"],
49
"parser": "@typescript-eslint/parser",
510
"parserOptions": {
611
"ecmaVersion": 9,
7-
"sourceType": "module",
8-
"project": "./tsconfig.json"
12+
"project": "./tsconfig.json",
13+
"sourceType": "module"
914
},
15+
"plugins": [
16+
"@typescript-eslint",
17+
"anti-trojan-source",
18+
"jest"
19+
],
1020
"rules": {
11-
"eslint-comments/no-use": "off",
12-
"filenames/match-regex": [2, "^[a-z_]+(\\.test)?$", true],
13-
"import/no-namespace": "off",
14-
"no-unused-vars": "off",
15-
"@typescript-eslint/no-unused-vars": "off",
16-
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
17-
"@typescript-eslint/no-require-imports": "error",
1821
"@typescript-eslint/array-type": "error",
1922
"@typescript-eslint/await-thenable": "error",
2023
"@typescript-eslint/ban-ts-comment": "error",
21-
"camelcase": "off",
2224
"@typescript-eslint/consistent-type-assertions": "error",
2325
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
26+
"@typescript-eslint/explicit-member-accessibility": ["error", {"accessibility": "no-public"}],
2427
"@typescript-eslint/func-call-spacing": ["error", "never"],
2528
"@typescript-eslint/no-array-constructor": "error",
2629
"@typescript-eslint/no-empty-interface": "error",
@@ -31,8 +34,10 @@
3134
"@typescript-eslint/no-misused-new": "error",
3235
"@typescript-eslint/no-namespace": "error",
3336
"@typescript-eslint/no-non-null-assertion": "warn",
37+
"@typescript-eslint/no-require-imports": "error",
3438
"@typescript-eslint/no-unnecessary-qualifier": "error",
3539
"@typescript-eslint/no-unnecessary-type-assertion": "error",
40+
"@typescript-eslint/no-unused-vars": "off",
3641
"@typescript-eslint/no-useless-constructor": "error",
3742
"@typescript-eslint/no-var-requires": "error",
3843
"@typescript-eslint/prefer-for-of": "warn",
@@ -42,16 +47,16 @@
4247
"@typescript-eslint/promise-function-async": "error",
4348
"@typescript-eslint/require-array-sort-compare": "error",
4449
"@typescript-eslint/restrict-plus-operands": "error",
45-
"semi": "off",
4650
"@typescript-eslint/semi": ["error", "never"],
4751
"@typescript-eslint/type-annotation-spacing": "error",
4852
"@typescript-eslint/unbound-method": "error",
49-
"i18n-text/no-en": "off"
50-
},
51-
"env": {
52-
"node": true,
53-
"jest": true,
54-
"es6": true,
55-
"jest/globals": true
53+
"anti-trojan-source/no-bidi": "error",
54+
"camelcase": "off",
55+
"eslint-comments/no-use": "off",
56+
"filenames/match-regex": [2, "^[a-z_]+(\\.test|\\.d)?$", true],
57+
"i18n-text/no-en": "off",
58+
"import/no-namespace": "off",
59+
"no-unused-vars": "off",
60+
"semi": "off"
5661
}
57-
}
62+
}

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
- uses: actions/checkout@v2
1616
- run: npm ci
1717
- run: npm run build
18+
- run: npm run lint
19+
- run: npm run format && git diff-files
1820
- run: npm run test
1921
- run: npm run package
2022
- name: Verify that `dist/index.js` is up to date

0 commit comments

Comments
 (0)