@askul-co-jp/eslint-config 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/LICENSE +21 -0
- package/README.md +132 -2
- package/flat-jest.js +1 -0
- package/flat-prettier.js +1 -0
- package/flat-typescript.js +1 -0
- package/flat.js +1 -0
- package/index.js +1 -0
- package/jest.js +1 -0
- package/package.json +108 -4
- package/prettier.js +1 -0
- package/src/flat/base.js +6 -0
- package/src/flat/jest.js +5 -0
- package/src/flat/prettier.js +6 -0
- package/src/flat/typescript.js +8 -0
- package/src/helpers/apply-files.js +15 -0
- package/src/helpers/compat.js +13 -0
- package/src/legacy/base.js +18 -0
- package/src/legacy/jest.js +15 -0
- package/src/legacy/prettier.js +6 -0
- package/src/legacy/typescript.js +16 -0
- package/src/shared/base-rules.js +102 -0
- package/typescript.js +1 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @askul-co-jp/eslint-config
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9d59719: ASKULフロントエンドプロジェクト向け共有ESLint設定の初回リリース。
|
|
8
|
+
|
|
9
|
+
- フロントエンドTypeScriptプロジェクト向けのbase設定を追加
|
|
10
|
+
- オプションのJest設定を追加
|
|
11
|
+
- legacy・flat両方の設定エントリポイントに対応
|
|
12
|
+
- `base` / `typescript` / `prettier` / `jest`の構成可能なエントリポイントに分割
|
|
13
|
+
- `typescript`エントリポイントを追加(legacy・flat対応、`@typescript-eslint`ルールを含む)
|
|
14
|
+
- `prettier`エントリポイントを追加(legacy・flat対応、`eslint-config-prettier` / `eslint-plugin-prettier`を利用)
|
|
15
|
+
- Node.jsの対応範囲を実行時依存関係の要件に合わせて設定
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) askul
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,133 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @askul-co-jp/eslint-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@askul-co-jp/eslint-config)
|
|
4
|
+
|
|
5
|
+
このパッケージは、ASKULのフロントエンド向けルールセットを共有ESLint設定として提供します。
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
このパッケージは、責務ごとに 4 つのレイヤーへ分割しています。
|
|
10
|
+
|
|
11
|
+
- `base`: JavaScript 共通ルール
|
|
12
|
+
- `typescript`: TypeScript 向け追加設定。型情報不要
|
|
13
|
+
- `prettier`: Prettier 連携
|
|
14
|
+
- `jest`: Jest 向け追加設定
|
|
15
|
+
|
|
16
|
+
必要な peerDependencies は次のコマンドで確認できます。
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm info "@askul-co-jp/eslint-config@latest" peerDependencies
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Legacy config
|
|
23
|
+
|
|
24
|
+
JavaScript only:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm i -D @askul-co-jp/eslint-config eslint@^8 eslint-plugin-import
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```js
|
|
31
|
+
module.exports = {
|
|
32
|
+
root: true,
|
|
33
|
+
extends: ["@askul-co-jp/eslint-config"],
|
|
34
|
+
};
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
TypeScript + Prettier:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm i -D @askul-co-jp/eslint-config eslint@^8 eslint-plugin-import typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-prettier eslint-plugin-prettier prettier
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```js
|
|
44
|
+
module.exports = {
|
|
45
|
+
root: true,
|
|
46
|
+
extends: [
|
|
47
|
+
"@askul-co-jp/eslint-config",
|
|
48
|
+
"@askul-co-jp/eslint-config/typescript",
|
|
49
|
+
"@askul-co-jp/eslint-config/prettier",
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
TypeScript + Prettier + Jest:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
npm i -D @askul-co-jp/eslint-config eslint@^8 eslint-plugin-import typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-prettier eslint-plugin-prettier prettier eslint-plugin-jest
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
module.exports = {
|
|
62
|
+
root: true,
|
|
63
|
+
extends: [
|
|
64
|
+
"@askul-co-jp/eslint-config",
|
|
65
|
+
"@askul-co-jp/eslint-config/typescript",
|
|
66
|
+
"@askul-co-jp/eslint-config/prettier",
|
|
67
|
+
"@askul-co-jp/eslint-config/jest",
|
|
68
|
+
],
|
|
69
|
+
};
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Flat config
|
|
73
|
+
|
|
74
|
+
JavaScript only:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
npm i -D @askul-co-jp/eslint-config eslint@^9 eslint-plugin-import
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```js
|
|
81
|
+
import askulFlat from "@askul-co-jp/eslint-config/flat";
|
|
82
|
+
|
|
83
|
+
export default [...askulFlat];
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
TypeScript + Prettier:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm i -D @askul-co-jp/eslint-config eslint@^9 eslint-plugin-import typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-prettier eslint-plugin-prettier prettier
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
```js
|
|
93
|
+
import askulFlat from "@askul-co-jp/eslint-config/flat";
|
|
94
|
+
import askulFlatTypescript from "@askul-co-jp/eslint-config/flat/typescript";
|
|
95
|
+
import askulFlatPrettier from "@askul-co-jp/eslint-config/flat/prettier";
|
|
96
|
+
|
|
97
|
+
export default [...askulFlat, ...askulFlatTypescript, ...askulFlatPrettier];
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
TypeScript + Prettier + Jest:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
npm i -D @askul-co-jp/eslint-config eslint@^9 eslint-plugin-import typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-prettier eslint-plugin-prettier prettier eslint-plugin-jest
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```js
|
|
107
|
+
import askulFlat from "@askul-co-jp/eslint-config/flat";
|
|
108
|
+
import askulFlatTypescript from "@askul-co-jp/eslint-config/flat/typescript";
|
|
109
|
+
import askulFlatPrettier from "@askul-co-jp/eslint-config/flat/prettier";
|
|
110
|
+
import askulFlatJest from "@askul-co-jp/eslint-config/flat/jest";
|
|
111
|
+
|
|
112
|
+
export default [
|
|
113
|
+
...askulFlat,
|
|
114
|
+
...askulFlatTypescript,
|
|
115
|
+
...askulFlatPrettier,
|
|
116
|
+
...askulFlatJest,
|
|
117
|
+
];
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Included rules
|
|
121
|
+
|
|
122
|
+
- `base`: `eslint:recommended`, `plugin:import/recommended`
|
|
123
|
+
- `typescript`: `plugin:@typescript-eslint/recommended`, `plugin:import/typescript`
|
|
124
|
+
- `prettier`: `plugin:prettier/recommended`
|
|
125
|
+
- `jest`: `plugin:jest/recommended`
|
|
126
|
+
|
|
127
|
+
## Requirements
|
|
128
|
+
|
|
129
|
+
- Node.js `^18.18.0 || ^20.9.0 || >=21.1.0`
|
|
130
|
+
- ESLint `>=8 <11`
|
|
131
|
+
|
|
132
|
+
注: `@askul-co-jp/eslint-config`、`/base`、`/typescript`、`/prettier`、`/jest` は `.eslintrc` 向けです。
|
|
133
|
+
注: `@askul-co-jp/eslint-config/flat`、`/flat/typescript`、`/flat/prettier`、`/flat/jest` は ESLint v9 の Flat Config 向けです。
|
package/flat-jest.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./src/flat/jest');
|
package/flat-prettier.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./src/flat/prettier');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./src/flat/typescript');
|
package/flat.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./src/flat/base');
|
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./src/legacy/base');
|
package/jest.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./src/legacy/jest');
|
package/package.json
CHANGED
|
@@ -1,6 +1,110 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askul-co-jp/eslint-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Shared ESLint config for ASKUL frontend projects",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./index.js",
|
|
8
|
+
"./base": "./index.js",
|
|
9
|
+
"./typescript": "./typescript.js",
|
|
10
|
+
"./prettier": "./prettier.js",
|
|
11
|
+
"./jest": "./jest.js",
|
|
12
|
+
"./flat": "./flat.js",
|
|
13
|
+
"./flat/typescript": "./flat-typescript.js",
|
|
14
|
+
"./flat/prettier": "./flat-prettier.js",
|
|
15
|
+
"./flat/jest": "./flat-jest.js"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"src/**/*.js",
|
|
19
|
+
"index.js",
|
|
20
|
+
"typescript.js",
|
|
21
|
+
"prettier.js",
|
|
22
|
+
"jest.js",
|
|
23
|
+
"flat.js",
|
|
24
|
+
"flat-typescript.js",
|
|
25
|
+
"flat-prettier.js",
|
|
26
|
+
"flat-jest.js",
|
|
27
|
+
"CHANGELOG.md",
|
|
28
|
+
"README.md",
|
|
29
|
+
"LICENSE"
|
|
30
|
+
],
|
|
31
|
+
"scripts": {
|
|
32
|
+
"lint": "eslint index.js flat.js flat-typescript.js flat-prettier.js flat-jest.js typescript.js prettier.js jest.js src --ext .js",
|
|
33
|
+
"test": "npm run test:all",
|
|
34
|
+
"test:all": "npm run test:legacy && npm run test:flat && npm run test:base-rule-cases",
|
|
35
|
+
"test:legacy": "eslint -c fixtures/legacy/base/.eslintrc.js fixtures/shared/base/src/sample.ts && eslint -c fixtures/legacy/jest/.eslintrc.js fixtures/shared/jest/src/sample.test.ts",
|
|
36
|
+
"test:flat": "ESLINT_USE_FLAT_CONFIG=true eslint --config fixtures/flat/base/eslint.config.js fixtures/shared/base/src/sample.ts && ESLINT_USE_FLAT_CONFIG=true eslint --config fixtures/flat/jest/eslint.config.js fixtures/shared/jest/src/sample.test.ts",
|
|
37
|
+
"test:base-rule-cases": "npm run test:base-rule-cases:legacy && npm run test:base-rule-cases:flat",
|
|
38
|
+
"test:base-rule-cases:legacy": "eslint -c fixtures/legacy/base/.eslintrc.js fixtures/shared/base/src/sample.ts \"fixtures/shared/base/src/rule-cases/*.ts\"",
|
|
39
|
+
"test:base-rule-cases:flat": "ESLINT_USE_FLAT_CONFIG=true eslint --config fixtures/flat/base/eslint.config.js fixtures/shared/base/src/sample.ts \"fixtures/shared/base/src/rule-cases/*.ts\"",
|
|
40
|
+
"changeset": "changeset",
|
|
41
|
+
"version-packages": "changeset version",
|
|
42
|
+
"release": "changeset publish"
|
|
43
|
+
},
|
|
44
|
+
"keywords": [
|
|
45
|
+
"eslint",
|
|
46
|
+
"eslintconfig",
|
|
47
|
+
"eslint-config",
|
|
48
|
+
"typescript",
|
|
49
|
+
"prettier",
|
|
50
|
+
"jest",
|
|
51
|
+
"flat-config",
|
|
52
|
+
"askul"
|
|
53
|
+
],
|
|
54
|
+
"license": "MIT",
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@typescript-eslint/eslint-plugin": ">=6 <9",
|
|
60
|
+
"@typescript-eslint/parser": ">=6 <9",
|
|
61
|
+
"eslint": ">=8 <11",
|
|
62
|
+
"eslint-config-prettier": ">=6 <11",
|
|
63
|
+
"eslint-plugin-import": ">=2 <3",
|
|
64
|
+
"eslint-plugin-jest": ">=24 <30",
|
|
65
|
+
"eslint-plugin-prettier": ">=3 <6",
|
|
66
|
+
"prettier": ">=2 <4",
|
|
67
|
+
"typescript": ">=5 <8"
|
|
68
|
+
},
|
|
69
|
+
"peerDependenciesMeta": {
|
|
70
|
+
"@typescript-eslint/eslint-plugin": {
|
|
71
|
+
"optional": true
|
|
72
|
+
},
|
|
73
|
+
"@typescript-eslint/parser": {
|
|
74
|
+
"optional": true
|
|
75
|
+
},
|
|
76
|
+
"eslint-config-prettier": {
|
|
77
|
+
"optional": true
|
|
78
|
+
},
|
|
79
|
+
"eslint-plugin-jest": {
|
|
80
|
+
"optional": true
|
|
81
|
+
},
|
|
82
|
+
"eslint-plugin-prettier": {
|
|
83
|
+
"optional": true
|
|
84
|
+
},
|
|
85
|
+
"prettier": {
|
|
86
|
+
"optional": true
|
|
87
|
+
},
|
|
88
|
+
"typescript": {
|
|
89
|
+
"optional": true
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"dependencies": {
|
|
93
|
+
"@eslint/eslintrc": "^3.3.7",
|
|
94
|
+
"@eslint/js": "^9.39.5"
|
|
95
|
+
},
|
|
96
|
+
"devDependencies": {
|
|
97
|
+
"@changesets/cli": "^2.31.1",
|
|
98
|
+
"@types/jest": "^30.0.0",
|
|
99
|
+
"@typescript-eslint/eslint-plugin": "^8.72.1",
|
|
100
|
+
"@typescript-eslint/parser": "^8.72.1",
|
|
101
|
+
"eslint": "^8.57.1",
|
|
102
|
+
"eslint-config-prettier": "^10.1.8",
|
|
103
|
+
"eslint-plugin-import": "^2.32.0",
|
|
104
|
+
"eslint-plugin-jest": "^29.17.0",
|
|
105
|
+
"eslint-plugin-prettier": "^5.5.7",
|
|
106
|
+
"jest": "^30.5.2",
|
|
107
|
+
"prettier": "^3.9.10",
|
|
108
|
+
"typescript": "5.9.3"
|
|
109
|
+
}
|
|
110
|
+
}
|
package/prettier.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./src/legacy/prettier');
|
package/src/flat/base.js
ADDED
package/src/flat/jest.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { FlatCompat } = require('@eslint/eslintrc');
|
|
2
|
+
const js = require('@eslint/js');
|
|
3
|
+
|
|
4
|
+
const createCompat = (baseDirectory) =>
|
|
5
|
+
new FlatCompat({
|
|
6
|
+
baseDirectory,
|
|
7
|
+
recommendedConfig: js.configs.recommended,
|
|
8
|
+
allConfig: js.configs.all
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
module.exports = {
|
|
12
|
+
createCompat
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const { baseRules } = require('../shared/base-rules');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
env: {
|
|
5
|
+
node: true,
|
|
6
|
+
browser: true,
|
|
7
|
+
amd: true
|
|
8
|
+
},
|
|
9
|
+
extends: [
|
|
10
|
+
'eslint:recommended',
|
|
11
|
+
'plugin:import/recommended'
|
|
12
|
+
],
|
|
13
|
+
plugins: ['import'],
|
|
14
|
+
parserOptions: {
|
|
15
|
+
sourceType: 'module'
|
|
16
|
+
},
|
|
17
|
+
rules: baseRules
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const { jestRules } = require('../shared/base-rules');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
overrides: [
|
|
5
|
+
{
|
|
6
|
+
files: ['**/*.test.js', '**/*.test.ts', '**/*.spec.js', '**/*.spec.ts', '**/__tests__/**/*.{js,ts}'],
|
|
7
|
+
plugins: ['jest'],
|
|
8
|
+
extends: ['plugin:jest/recommended'],
|
|
9
|
+
env: {
|
|
10
|
+
'jest/globals': true
|
|
11
|
+
},
|
|
12
|
+
rules: jestRules
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const { typescriptRules } = require('../shared/base-rules');
|
|
2
|
+
|
|
3
|
+
module.exports = {
|
|
4
|
+
overrides: [
|
|
5
|
+
{
|
|
6
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
7
|
+
extends: ['plugin:@typescript-eslint/recommended', 'plugin:import/typescript'],
|
|
8
|
+
plugins: ['@typescript-eslint'],
|
|
9
|
+
parser: '@typescript-eslint/parser',
|
|
10
|
+
parserOptions: {
|
|
11
|
+
sourceType: 'module'
|
|
12
|
+
},
|
|
13
|
+
rules: typescriptRules
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
const baseRules = {
|
|
2
|
+
'no-undef': 'error',
|
|
3
|
+
'no-unreachable': 'error',
|
|
4
|
+
'valid-typeof': 'error',
|
|
5
|
+
'use-isnan': 'error',
|
|
6
|
+
'no-dupe-keys': 'error',
|
|
7
|
+
'no-dupe-args': 'error',
|
|
8
|
+
'no-const-assign': 'error',
|
|
9
|
+
'no-func-assign': 'error',
|
|
10
|
+
'no-import-assign': 'error',
|
|
11
|
+
'no-unsafe-finally': 'error',
|
|
12
|
+
'no-unsafe-negation': 'error',
|
|
13
|
+
'no-this-before-super': 'error',
|
|
14
|
+
'constructor-super': 'error',
|
|
15
|
+
'getter-return': 'error',
|
|
16
|
+
'no-prototype-builtins': 'error',
|
|
17
|
+
'no-global-assign': 'error',
|
|
18
|
+
'no-obj-calls': 'error',
|
|
19
|
+
'no-sparse-arrays': 'error',
|
|
20
|
+
'no-unexpected-multiline': 'error',
|
|
21
|
+
'no-unreachable-loop': 'warn',
|
|
22
|
+
'no-duplicate-case': 'error',
|
|
23
|
+
'no-irregular-whitespace': 'error',
|
|
24
|
+
'no-empty-pattern': 'error',
|
|
25
|
+
'no-cond-assign': 'error',
|
|
26
|
+
'no-fallthrough': 'error',
|
|
27
|
+
eqeqeq: 'error',
|
|
28
|
+
'no-eval': 'error',
|
|
29
|
+
'no-implied-eval': 'error',
|
|
30
|
+
'no-new-func': 'error',
|
|
31
|
+
'no-restricted-globals': [
|
|
32
|
+
'warn',
|
|
33
|
+
'location',
|
|
34
|
+
'name',
|
|
35
|
+
'event',
|
|
36
|
+
'history',
|
|
37
|
+
'status',
|
|
38
|
+
'parent',
|
|
39
|
+
'top',
|
|
40
|
+
'self'
|
|
41
|
+
],
|
|
42
|
+
'no-script-url': 'error',
|
|
43
|
+
'no-debugger': 'error',
|
|
44
|
+
'no-console': 'warn',
|
|
45
|
+
'prefer-object-has-own': 'error',
|
|
46
|
+
'prefer-regex-literals': 'warn',
|
|
47
|
+
'import/no-cycle': 'error',
|
|
48
|
+
'import/no-duplicates': 'error',
|
|
49
|
+
'import/order': [
|
|
50
|
+
'error',
|
|
51
|
+
{
|
|
52
|
+
'newlines-between': 'always',
|
|
53
|
+
alphabetize: {
|
|
54
|
+
order: 'asc',
|
|
55
|
+
caseInsensitive: true
|
|
56
|
+
},
|
|
57
|
+
groups: [
|
|
58
|
+
'builtin',
|
|
59
|
+
'external',
|
|
60
|
+
'internal',
|
|
61
|
+
'parent',
|
|
62
|
+
'sibling',
|
|
63
|
+
'index',
|
|
64
|
+
'object',
|
|
65
|
+
'type'
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
'no-use-before-define': 'error',
|
|
70
|
+
'prefer-arrow-callback': 'error',
|
|
71
|
+
'require-await': 'warn',
|
|
72
|
+
'no-useless-return': 'error',
|
|
73
|
+
'prefer-const': 'error',
|
|
74
|
+
'no-var': 'error'
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const typescriptRules = {
|
|
78
|
+
'@typescript-eslint/ban-ts-comment': 'error',
|
|
79
|
+
'@typescript-eslint/no-shadow': 'error',
|
|
80
|
+
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
|
|
81
|
+
'@typescript-eslint/no-redeclare': 'error',
|
|
82
|
+
'no-shadow': 'off',
|
|
83
|
+
'no-redeclare': 'off',
|
|
84
|
+
'no-use-before-define': 'off'
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const prettierRules = {
|
|
88
|
+
'prettier/prettier': 'error'
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const jestRules = {
|
|
92
|
+
'jest/prefer-to-be': 'warn',
|
|
93
|
+
'jest/prefer-to-have-length': 'warn',
|
|
94
|
+
'jest/prefer-to-contain': 'warn'
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
module.exports = {
|
|
98
|
+
baseRules,
|
|
99
|
+
typescriptRules,
|
|
100
|
+
prettierRules,
|
|
101
|
+
jestRules
|
|
102
|
+
};
|
package/typescript.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./src/legacy/typescript');
|