Skip to content

Commit d22c43f

Browse files
committed
feat: Support ESLint 7.x
BREAKING CHANGE: Requires Node@^10.12.x || 12.x BREAKING CHANGE: Requires ESLint@^7.x
1 parent 21838c6 commit d22c43f

File tree

10 files changed

+257
-71
lines changed

10 files changed

+257
-71
lines changed

.github/workflows/CI.yml

+21-6
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,32 @@ on:
1010
jobs:
1111
test:
1212
name: Test
13-
runs-on: ubuntu-latest
1413
strategy:
1514
matrix:
16-
node: [12.x, 10.x, 8.x]
15+
os: [ubuntu-latest]
16+
eslint: [7]
17+
node: [14]
18+
include:
19+
# On other platforms
20+
- eslint: 7
21+
node: 14
22+
os: windows-latest
23+
- eslint: 7
24+
node: 14
25+
os: macos-latest
26+
# On old Node.js versions
27+
- eslint: 7
28+
node: 12
29+
os: ubuntu-latest
30+
- eslint: 7
31+
node: 10
32+
os: ubuntu-latest
33+
runs-on: ${{ matrix.os }}
1734
steps:
1835
- name: Checkout
19-
uses: actions/checkout@v1
20-
with:
21-
fetch-depth: 1
36+
uses: actions/checkout@v2
2237
- name: Install Node.js ${{ matrix.node }}
23-
uses: actions/setup-node@v1
38+
uses: actions/setup-node@v2
2439
with:
2540
node-version: ${{ matrix.node }}
2641
- name: Install Packages

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ npm install --save-dev eslint @mysticatea/eslint-plugin
1616

1717
### Requirements
1818

19-
- Node.js `^8.10.0` or newer versions.
20-
- ESLint `^6.3.0` or newer versions.
19+
- Node.js `^10.12.0 || >=12.0.0` or newer versions.
20+
- ESLint `^7.0.0` or newer versions.
2121

2222
## 📖 Usage
2323

lib/configs/+eslint-plugin.js

+4
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,22 @@ module.exports = {
3434
"@mysticatea/eslint-plugin/no-missing-placeholders": "error",
3535
"@mysticatea/eslint-plugin/no-unused-placeholders": "error",
3636
"@mysticatea/eslint-plugin/no-useless-token-range": "error",
37+
"@mysticatea/eslint-plugin/prefer-object-rule": "error",
3738
"@mysticatea/eslint-plugin/prefer-output-null": "error",
3839
"@mysticatea/eslint-plugin/prefer-placeholders": "error",
3940
"@mysticatea/eslint-plugin/prefer-replace-text": "error",
4041
"@mysticatea/eslint-plugin/report-message-format": [
4142
"error",
4243
"[^a-z'\"{].*\\.$",
4344
],
45+
"@mysticatea/eslint-plugin/require-meta-docs-description":
46+
"error",
4447
"@mysticatea/eslint-plugin/require-meta-docs-url": [
4548
"error",
4649
{ pattern: rulesDocumentUrl },
4750
],
4851
"@mysticatea/eslint-plugin/require-meta-fixable": "error",
52+
"@mysticatea/eslint-plugin/require-meta-schema": "error",
4953
"@mysticatea/eslint-plugin/require-meta-type": "error",
5054
"@mysticatea/eslint-plugin/test-case-property-ordering": [
5155
"error",

lib/configs/+node.js

+11
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,30 @@ module.exports = {
4646
require: "readonly",
4747
},
4848
rules: {
49+
"@mysticatea/node/callback-return": "error",
4950
"@mysticatea/node/exports-style": ["error", "module.exports"],
5051
"@mysticatea/node/file-extension-in-import": [
5152
"error",
5253
"always",
5354
{ ".js": "never", ".ts": "never", ".tsx": "never" },
5455
],
56+
"@mysticatea/node/global-require": "error",
57+
"@mysticatea/node/handle-callback-err": "error",
5558
"@mysticatea/node/no-callback-literal": "off",
5659
"@mysticatea/node/no-deprecated-api": "error",
5760
"@mysticatea/node/no-exports-assign": "error",
5861
"@mysticatea/node/no-extraneous-import": "error",
5962
"@mysticatea/node/no-extraneous-require": "error",
6063
"@mysticatea/node/no-missing-import": "error",
6164
"@mysticatea/node/no-missing-require": "error",
65+
"@mysticatea/node/no-mixed-requires": "error",
66+
"@mysticatea/node/no-new-require": "error",
67+
"@mysticatea/node/no-path-concat": "error",
68+
"@mysticatea/node/no-process-env": "error",
69+
"@mysticatea/node/no-process-exit": "error",
70+
"@mysticatea/node/no-restricted-import": "error",
71+
"@mysticatea/node/no-restricted-require": "error",
72+
"@mysticatea/node/no-sync": "error",
6273
"@mysticatea/node/no-unpublished-bin": "error",
6374
"@mysticatea/node/no-unpublished-import": "error",
6475
"@mysticatea/node/no-unpublished-require": "error",

lib/configs/_base.js

+15
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@ module.exports = {
2727
"consistent-return": "error",
2828
curly: "error",
2929
"default-case": "error",
30+
"default-case-last": "error",
3031
"default-param-last": "error",
3132
"dot-notation": "error",
3233
eqeqeq: ["error", "always", { null: "ignore" }],
3334
"for-direction": "error",
3435
"func-style": ["error", "declaration"],
3536
"getter-return": "error",
37+
"grouped-accessor-pairs": "error",
3638
"init-declarations": "error",
3739
"linebreak-style": ["error", "unix"],
3840
"lines-between-class-members": "error",
@@ -47,11 +49,13 @@ module.exports = {
4749
"no-compare-neg-zero": "error",
4850
"no-cond-assign": "error",
4951
"no-constant-condition": "error",
52+
"no-constructor-return": "error",
5053
"no-control-regex": "error",
5154
"no-debugger": "error",
5255
"no-delete-var": "error",
5356
"no-div-regex": "error",
5457
"no-dupe-args": "error",
58+
"no-dupe-else-if": "error",
5559
"no-dupe-keys": "error",
5660
"no-duplicate-case": "error",
5761
"no-else-return": "error",
@@ -89,6 +93,7 @@ module.exports = {
8993
"no-lone-blocks": "error",
9094
"no-lonely-if": "error",
9195
"no-loop-func": "error",
96+
"no-loss-of-precision": "error",
9297
"no-misleading-character-class": "error",
9398
"no-mixed-operators": [
9499
"error",
@@ -103,10 +108,12 @@ module.exports = {
103108
"no-new-object": "error",
104109
"no-new-require": "error",
105110
"no-new-wrappers": "error",
111+
"no-nonoctal-decimal-escape": "error",
106112
"no-obj-calls": "error",
107113
"no-octal": "error",
108114
"no-octal-escape": "error",
109115
"no-param-reassign": ["error", { props: false }],
116+
"no-promise-executor-return": "error",
110117
"no-process-env": "error",
111118
"no-process-exit": "error",
112119
"no-prototype-builtins": "error",
@@ -128,6 +135,7 @@ module.exports = {
128135
"no-self-assign": ["error", { props: true }],
129136
"no-self-compare": "error",
130137
"no-sequences": "error",
138+
"no-setter-return": "error",
131139
"no-shadow": ["error", { builtinGlobals: true }],
132140
"no-shadow-restricted-names": "error",
133141
"no-sparse-arrays": "error",
@@ -138,8 +146,10 @@ module.exports = {
138146
"no-unmodified-loop-condition": "error",
139147
"no-unneeded-ternary": "error",
140148
"no-unreachable": "error",
149+
"no-unreachable-loop": "error",
141150
"no-unsafe-finally": "error",
142151
"no-unsafe-negation": ["error", { enforceForOrderingRelations: true }],
152+
"no-unsafe-optional-chaining": "error",
143153
"no-unused-expressions": "error",
144154
"no-unused-labels": "error",
145155
"no-unused-vars": [
@@ -153,6 +163,7 @@ module.exports = {
153163
},
154164
],
155165
"no-use-before-define": ["error", "nofunc"],
166+
"no-useless-backreference": "error",
156167
"no-useless-call": "error",
157168
"no-useless-catch": "error",
158169
"no-useless-concat": "error",
@@ -173,6 +184,7 @@ module.exports = {
173184
{ blankLine: "always", next: "function", prev: "*" },
174185
{ blankLine: "always", next: "*", prev: "function" },
175186
],
187+
"prefer-exponentiation-operator": "error",
176188
"prefer-promise-reject-errors": "error",
177189
"prefer-regex-literals": "error",
178190
quotes: ["error", "double", { avoidEscape: true }],
@@ -294,6 +306,7 @@ module.exports = {
294306
"guard-for-in": "off",
295307
"handle-callback-err": "off",
296308
"id-blacklist": "off",
309+
"id-denylist": "off",
297310
"id-length": "off",
298311
"id-match": "off",
299312
"line-comment-position": "off",
@@ -327,6 +340,7 @@ module.exports = {
327340
"no-path-concat": "off",
328341
"no-plusplus": "off",
329342
"no-proto": "off",
343+
"no-restricted-exports": "off",
330344
"no-restricted-globals": "off",
331345
"no-restricted-imports": "off",
332346
"no-restricted-modules": "off",
@@ -387,6 +401,7 @@ module.exports = {
387401
],
388402
},
389403
],
404+
"@mysticatea/eslint-comments/require-description": "error",
390405

391406
// prettier
392407
"@mysticatea/prettier": [

lib/configs/_override-special.js

-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module.exports = {
1818
extends: [require.resolve("./+node.js")],
1919
rules: {
2020
"no-console": "off",
21-
"no-process-env": "off",
2221
},
2322
},
2423
{
@@ -33,7 +32,6 @@ module.exports = {
3332
],
3433
rules: {
3534
"no-console": "off",
36-
"no-process-env": "off",
3735
},
3836
},
3937
],

lib/configs/_override-ts.js

+46-8
Original file line numberDiff line numberDiff line change
@@ -19,40 +19,79 @@ module.exports = {
1919
"@mysticatea/ts/adjacent-overload-signatures": "error",
2020
"@mysticatea/ts/array-type": "error",
2121
"@mysticatea/ts/await-thenable": "error",
22-
"@mysticatea/ts/ban-ts-ignore": "error",
23-
"@mysticatea/ts/class-name-casing": "error",
22+
"@mysticatea/ts/ban-ts-comment": "error",
23+
"@mysticatea/ts/ban-tslint-comment": "error",
24+
"@mysticatea/ts/class-literal-property-style": "error",
25+
"@mysticatea/ts/comma-spacing": "error",
26+
"@mysticatea/ts/no-confusing-non-null-assertion": "error",
2427
"@mysticatea/ts/consistent-type-assertions": "error",
28+
"@mysticatea/ts/default-param-last": "error",
29+
"@mysticatea/ts/dot-notation": "error",
2530
"@mysticatea/ts/explicit-member-accessibility": "error",
26-
"@mysticatea/ts/interface-name-prefix": "error",
27-
"@mysticatea/ts/member-naming": "error",
31+
"@mysticatea/ts/explicit-module-boundary-types": "error",
32+
"@mysticatea/ts/init-declarations": "error",
33+
"@mysticatea/ts/keyword-spacing": "error",
34+
"@mysticatea/ts/method-signature-style": "error",
35+
"@mysticatea/ts/naming-convention": "error",
2836
"@mysticatea/ts/no-array-constructor": "error",
37+
"@mysticatea/ts/no-base-to-string": "error",
38+
"@mysticatea/ts/no-dupe-class-members": "error",
39+
"@mysticatea/ts/no-dynamic-delete": "error",
2940
"@mysticatea/ts/no-empty-interface": "error",
41+
"@mysticatea/ts/no-implicit-any-catch": "error",
42+
"@mysticatea/ts/no-extra-non-null-assertion": "error",
43+
"@mysticatea/ts/no-extra-semi": "error",
3044
"@mysticatea/ts/no-extraneous-class": "error",
3145
"@mysticatea/ts/no-floating-promises": "error",
3246
"@mysticatea/ts/no-for-in-array": "error",
47+
"@mysticatea/ts/no-implied-eval": "error",
3348
"@mysticatea/ts/no-inferrable-types": "error",
49+
"@mysticatea/ts/no-invalid-this": "error",
50+
"@mysticatea/ts/no-invalid-void-type": "error",
3451
"@mysticatea/ts/no-misused-new": "error",
3552
"@mysticatea/ts/no-misused-promises": "error",
53+
"@mysticatea/ts/no-non-null-asserted-optional-chain": "error",
3654
"@mysticatea/ts/no-parameter-properties": "error",
3755
"@mysticatea/ts/no-require-imports": "error",
3856
"@mysticatea/ts/no-this-alias": [
3957
"error",
4058
{ allowDestructuring: true },
4159
],
60+
"@mysticatea/ts/no-throw-literal": "error",
61+
"@mysticatea/ts/no-unnecessary-boolean-literal-compare":
62+
"error",
4263
"@mysticatea/ts/no-unnecessary-qualifier": "error",
4364
"@mysticatea/ts/no-unnecessary-type-arguments": "error",
4465
"@mysticatea/ts/no-unnecessary-type-assertion": "error",
66+
"@mysticatea/ts/no-unsafe-assignment": "error",
67+
"@mysticatea/ts/no-unsafe-call": "error",
68+
"@mysticatea/ts/no-unsafe-member-access": "error",
69+
"@mysticatea/ts/no-unsafe-return": "error",
70+
"@mysticatea/ts/no-unused-expressions": "error",
71+
"@mysticatea/ts/no-unused-vars-experimental": "error",
4572
"@mysticatea/ts/no-var-requires": "error",
73+
"@mysticatea/ts/prefer-as-const": "error",
74+
"@mysticatea/ts/prefer-enum-initializers": "error",
4675
// https://github.com/typescript-eslint/typescript-eslint/issues/454
4776
"@mysticatea/ts/prefer-function-type": "off",
4877
"@mysticatea/ts/prefer-includes": "error",
78+
"@mysticatea/ts/prefer-literal-enum-member": "error",
4979
"@mysticatea/ts/prefer-namespace-keyword": "error",
80+
"@mysticatea/ts/prefer-nullish-coalescing": "error",
81+
"@mysticatea/ts/prefer-optional-chain": "error",
82+
"@mysticatea/ts/prefer-readonly-parameter-types": "error",
5083
// https://github.com/typescript-eslint/typescript-eslint/issues/946
5184
"@mysticatea/ts/prefer-readonly": "off",
85+
"@mysticatea/ts/prefer-reduce-type-parameter": "off",
5286
"@mysticatea/ts/prefer-regexp-exec": "error",
5387
"@mysticatea/ts/prefer-string-starts-ends-with": "error",
88+
"@mysticatea/ts/prefer-ts-expect-error": "off",
89+
"@mysticatea/ts/require-array-sort-compare": "off",
5490
"@mysticatea/ts/restrict-plus-operands": "error",
55-
"@mysticatea/ts/require-array-sort-compare": "error",
91+
"@mysticatea/ts/restrict-template-expressions": "error",
92+
"@mysticatea/ts/return-await": "error",
93+
"@mysticatea/ts/space-before-function-paren": "error",
94+
"@mysticatea/ts/switch-exhaustiveness-check": "error",
5695
"@mysticatea/ts/triple-slash-reference": "error",
5796
// なんか誤検知が多い...
5897
"@mysticatea/ts/unbound-method": [
@@ -61,6 +100,8 @@ module.exports = {
61100
],
62101
// https://github.com/typescript-eslint/typescript-eslint/issues/452
63102
"@mysticatea/ts/unified-signatures": "off",
103+
"@mysticatea/ts/lines-between-class-members": "error",
104+
"@mysticatea/ts/no-loss-of-precision": "error",
64105
"@mysticatea/prettier": [
65106
"error",
66107
{
@@ -75,8 +116,6 @@ module.exports = {
75116
],
76117

77118
// Replacements
78-
camelcase: "off",
79-
"@mysticatea/ts/camelcase": "error",
80119
"no-empty-function": "off",
81120
"@mysticatea/ts/no-empty-function": "error",
82121
"no-useless-constructor": "off",
@@ -101,7 +140,6 @@ module.exports = {
101140
"@mysticatea/ts/consistent-type-definitions": "off",
102141
"@mysticatea/ts/explicit-function-return-type": "off", // I want but this is not so...
103142
"@mysticatea/ts/func-call-spacing": "off", // favor of Prettier.
104-
"@mysticatea/ts/generic-type-naming": "off",
105143
"@mysticatea/ts/indent": "off", // favor of Prettier.
106144
"@mysticatea/ts/member-delimiter-style": "off", // favor of Prettier.
107145
"@mysticatea/ts/member-ordering": "off",

0 commit comments

Comments
 (0)