Skip to content

Commit 34b4539

Browse files
committed
💥 update dependencies and configs
1 parent 5635a15 commit 34b4539

File tree

9 files changed

+101
-22
lines changed

9 files changed

+101
-22
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ npm install --save-dev eslint @mysticatea/eslint-plugin
1616

1717
### Requirements
1818

19-
- Node.js `^6.5.0`, `^8.0.0`, `^9.0.0` or newer versions.
20-
- ESLint `^4.19.1` or newer versions.
19+
- Node.js `^8.10.0` or newer versions.
20+
- ESLint `^6.3.0` or newer versions.
2121

2222
## 📖 Usage
2323

2424
Write in your ESLint configurations: http://eslint.org/docs/user-guide/configuring#using-the-configuration-from-a-plugin
2525

2626
### Configs
2727

28+
- `plugin:@mysticatea/es2020` ... Basic configuration for ES2020.
2829
- `plugin:@mysticatea/es2019` ... Basic configuration for ES2019.
2930
- `plugin:@mysticatea/es2018` ... Basic configuration for ES2018.
3031
- `plugin:@mysticatea/es2017` ... Basic configuration for ES2017.

lib/configs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ module.exports = {
1313
es2017: require("./configs/es2017"),
1414
es2018: require("./configs/es2018"),
1515
es2019: require("./configs/es2019"),
16+
es2020: require("./configs/es2020"),
1617
es5: require("./configs/es5"),
1718
}

lib/configs/+node.js

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,37 @@ module.exports = {
1212
ecmaVersion: 2019,
1313
},
1414
globals: {
15-
Buffer: false,
16-
URL: false,
17-
URLSearchParams: false,
18-
clearImmediate: false,
19-
global: false,
20-
process: false,
21-
setImmediate: false,
15+
// ECMAScript (experimental)
16+
globalThis: "readonly",
17+
// ECMA-404
18+
Intl: "readonly",
19+
20+
// Web Standard
21+
TextDecoder: "readonly",
22+
TextEncoder: "readonly",
23+
URL: "readonly",
24+
URLSearchParams: "readonly",
25+
WebAssembly: "readonly",
26+
clearInterval: "readonly",
27+
clearTimeout: "readonly",
28+
console: "readonly",
29+
queueMicrotask: "readonly",
30+
setInterval: "readonly",
31+
setTimeout: "readonly",
32+
33+
// Node.js
34+
Buffer: "readonly",
35+
GLOBAL: "readonly",
36+
clearImmediate: "readonly",
37+
global: "readonly",
38+
process: "readonly",
39+
root: "readonly",
40+
setImmediate: "readonly",
2241
},
2342
rules: {
43+
"@mysticatea/node/no-callback-literal": "off",
2444
"@mysticatea/node/no-deprecated-api": "error",
45+
"@mysticatea/node/no-exports-assign": "error",
2546
"@mysticatea/node/no-unpublished-bin": "error",
2647
"@mysticatea/node/no-unsupported-features/es-builtins": "error",
2748
"@mysticatea/node/no-unsupported-features/es-syntax": "error",

lib/configs/_ts.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,36 +22,39 @@ module.exports = {
2222
"@mysticatea/ts/await-thenable": "error",
2323
"@mysticatea/ts/ban-ts-ignore": "error",
2424
"@mysticatea/ts/class-name-casing": "error",
25+
"@mysticatea/ts/consistent-type-assertions": "error",
2526
"@mysticatea/ts/explicit-member-accessibility": "error",
2627
"@mysticatea/ts/interface-name-prefix": "error",
2728
"@mysticatea/ts/member-naming": "error",
28-
"@mysticatea/ts/no-angle-bracket-type-assertion": "error",
2929
"@mysticatea/ts/no-array-constructor": "error",
3030
"@mysticatea/ts/no-empty-interface": "error",
3131
"@mysticatea/ts/no-extraneous-class": "error",
3232
"@mysticatea/ts/no-floating-promises": "error",
3333
"@mysticatea/ts/no-for-in-array": "error",
3434
"@mysticatea/ts/no-inferrable-types": "error",
3535
"@mysticatea/ts/no-misused-new": "error",
36-
"@mysticatea/ts/no-object-literal-type-assertion": "error",
36+
"@mysticatea/ts/no-misused-promises": "error",
3737
"@mysticatea/ts/no-parameter-properties": "error",
3838
"@mysticatea/ts/no-require-imports": "error",
3939
"@mysticatea/ts/no-this-alias": [
4040
"error",
4141
{ allowDestructuring: true },
4242
],
43-
"@mysticatea/ts/no-triple-slash-reference": "error",
4443
"@mysticatea/ts/no-unnecessary-qualifier": "error",
44+
"@mysticatea/ts/no-unnecessary-type-arguments": "error",
4545
"@mysticatea/ts/no-unnecessary-type-assertion": "error",
4646
"@mysticatea/ts/no-var-requires": "error",
4747
// https://github.com/typescript-eslint/typescript-eslint/issues/454
4848
"@mysticatea/ts/prefer-function-type": "off",
4949
"@mysticatea/ts/prefer-includes": "error",
5050
"@mysticatea/ts/prefer-namespace-keyword": "error",
51+
"@mysticatea/ts/prefer-readonly": "error",
5152
"@mysticatea/ts/prefer-regexp-exec": "error",
5253
"@mysticatea/ts/prefer-string-starts-ends-with": "error",
5354
"@mysticatea/ts/restrict-plus-operands": "error",
5455
"@mysticatea/ts/require-array-sort-compare": "error",
56+
"@mysticatea/ts/strict-boolean-expressions": "error",
57+
"@mysticatea/ts/triple-slash-reference": "error",
5558
"@mysticatea/ts/unbound-method": [
5659
"error",
5760
{ ignoreStatic: true },
@@ -78,6 +81,8 @@ module.exports = {
7881
"@mysticatea/ts/no-empty-function": "error",
7982
"no-useless-constructor": "off",
8083
"@mysticatea/ts/no-useless-constructor": "error",
84+
"require-await": "off",
85+
"@mysticatea/ts/require-await": "error",
8186

8287
// Disabled rules
8388
"func-style": "off",
@@ -109,8 +114,10 @@ module.exports = {
109114
"@mysticatea/ts/no-use-before-define": "off", // tsc verifies it.
110115
"@mysticatea/ts/prefer-for-of": "off",
111116
"@mysticatea/ts/promise-function-async": "off",
117+
"@mysticatea/ts/quotes": "off", // favor of Prettier.
112118
"@mysticatea/ts/semi": "off", // favor of Prettier.
113119
"@mysticatea/ts/type-annotation-spacing": "off", // favor of Prettier.
120+
"@mysticatea/ts/typedef": "off",
114121
},
115122
settings: {
116123
node: {

lib/configs/es2020.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @author Toru Nagashima
3+
* See LICENSE file in root directory for full license.
4+
*/
5+
"use strict"
6+
7+
module.exports = {
8+
extends: ["plugin:@mysticatea/es2019"],
9+
parserOptions: {
10+
ecmaVersion: 2020,
11+
},
12+
globals: {
13+
BigInt: "readonly",
14+
BigInt64Array: "readonly",
15+
BigUint64Array: "readonly",
16+
},
17+
rules: {},
18+
}

lib/configs/es5.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ module.exports = merge(
236236
"dot-location": "off",
237237
"eol-last": "off",
238238
"func-call-spacing": "off",
239+
"function-call-argument-newline": "off",
239240
"function-paren-newline": "off",
240241
"generator-star-spacing": "off",
241242
"implicit-arrow-linebreak": "off",

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
"version": "11.0.0",
44
"description": "Additional ESLint rules.",
55
"engines": {
6-
"node": ">=6.5.0"
6+
"node": ">=8.10.0"
77
},
88
"main": "index.js",
99
"files": [
1010
"lib"
1111
],
1212
"peerDependencies": {
13-
"eslint": ">=5.16.0"
13+
"eslint": ">=6.3.0"
1414
},
1515
"dependencies": {
16-
"@typescript-eslint/eslint-plugin": "~1.11.0",
17-
"@typescript-eslint/parser": "~1.11.0",
16+
"@typescript-eslint/eslint-plugin": "~2.1.0",
17+
"@typescript-eslint/parser": "~2.1.0",
1818
"eslint-plugin-eslint-comments": "~3.1.2",
1919
"eslint-plugin-eslint-plugin": "~2.1.0",
20-
"eslint-plugin-node": "~9.1.0",
20+
"eslint-plugin-node": "~10.0.0",
2121
"eslint-plugin-prettier": "~3.1.0",
2222
"eslint-plugin-vue": "~5.2.3",
2323
"prettier": "~1.18.2",
@@ -26,15 +26,15 @@
2626
"devDependencies": {
2727
"@mysticatea/eslint-plugin": "file:.",
2828
"codecov": "^3.5.0",
29-
"eslint": "~6.0.1",
29+
"eslint": "~6.3.0",
3030
"fs-extra": "^8.1.0",
31-
"globals": "^11.12.0",
32-
"mocha": "^6.1.4",
31+
"globals": "^12.0.0",
32+
"mocha": "^6.2.0",
3333
"npm-run-all": "^4.1.5",
3434
"nyc": "^14.1.1",
3535
"opener": "^1.5.1",
36-
"rimraf": "^2.6.3",
37-
"typescript": "~3.5.2"
36+
"rimraf": "^3.0.0",
37+
"typescript": "~3.6.2"
3838
},
3939
"scripts": {
4040
"clean": "rimraf .nyc_output coverage",

tests/lib/configs/es2019.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @author Toru Nagashima
3+
* See LICENSE file in root directory for full license.
4+
*/
5+
"use strict"
6+
7+
const Rules = require("./_rules")
8+
9+
describe("'es2019.js'", () => {
10+
const config = require("../../../lib/configs/es2019")
11+
12+
it("should be a valid config.", () => {
13+
Rules.validateConfig(config, "es2019.js")
14+
})
15+
})

tests/lib/configs/es2020.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* @author Toru Nagashima
3+
* See LICENSE file in root directory for full license.
4+
*/
5+
"use strict"
6+
7+
const Rules = require("./_rules")
8+
9+
describe("'es2020.js'", () => {
10+
const config = require("../../../lib/configs/es2020")
11+
12+
it("should be a valid config.", () => {
13+
Rules.validateConfig(config, "es2020.js")
14+
})
15+
})

0 commit comments

Comments
 (0)