eslint-config-moneyforward 2.0.0 → 3.0.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/.eslintrc.js +8 -3
- package/.github/workflows/check_pull_request_title.yml +37 -0
- package/.github/workflows/release.yml +31 -0
- package/.node-version +1 -0
- package/CHANGELOG.md +44 -0
- package/README.md +72 -30
- package/configs/essentials.js +15 -0
- package/configs/jsdoc.js +3 -0
- package/configs/next.js +1 -6
- package/configs/node.js +1 -4
- package/configs/react.js +1 -19
- package/configs/storybook.js +12 -0
- package/configs/test/react.js +15 -0
- package/configs/typescript.js +2 -9
- package/package.json +45 -18
- package/release.config.js +24 -0
- package/rules/best-practices.js +472 -0
- package/rules/errors.js +208 -0
- package/rules/es6.js +217 -0
- package/rules/imports.js +297 -0
- package/rules/jest-dom.js +4 -0
- package/rules/jest.js +7 -2
- package/rules/jsdoc.js +133 -0
- package/rules/jsx-a11y.js +285 -0
- package/rules/next.js +15 -2
- package/rules/node.js +15 -2
- package/rules/promise.js +16 -0
- package/rules/react-hooks.js +13 -0
- package/rules/react.js +540 -2
- package/rules/storybook.js +28 -0
- package/rules/style.js +693 -0
- package/rules/testing-library/react.js +2 -1
- package/rules/typescript.js +148 -2
- package/rules/variables.js +84 -0
- package/tests/requires.test.js +40 -20
- package/.release-it.json +0 -8
- package/configs/base.js +0 -9
- package/configs/jest.js +0 -15
- package/configs/prettier.js +0 -6
- package/configs/testing-library/react.js +0 -17
- package/rules/index.js +0 -4
- package/rules/prettier.js +0 -4
package/.eslintrc.js
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
extends: ['./configs/
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
extends: ['./configs/essentials', './configs/node', 'prettier'],
|
|
3
|
+
|
|
4
|
+
overrides: [
|
|
5
|
+
{
|
|
6
|
+
files: ['*.test.js'],
|
|
7
|
+
extends: ['./rules/jest'],
|
|
8
|
+
},
|
|
9
|
+
],
|
|
5
10
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Check Pull Request Title
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request_target:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- edited
|
|
8
|
+
- reopened
|
|
9
|
+
- synchronize
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
pull-requests: read
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
check:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: amannn/action-semantic-pull-request@v5
|
|
19
|
+
env:
|
|
20
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
21
|
+
with:
|
|
22
|
+
# Based on the Angular convention
|
|
23
|
+
# cf. https://github.com/angular/angular/blob/22b96b9/CONTRIBUTING.md#-commit-message-guidelines
|
|
24
|
+
types: |
|
|
25
|
+
feat
|
|
26
|
+
fix
|
|
27
|
+
docs
|
|
28
|
+
style
|
|
29
|
+
refactor
|
|
30
|
+
perf
|
|
31
|
+
test
|
|
32
|
+
build
|
|
33
|
+
ci
|
|
34
|
+
chore
|
|
35
|
+
revert
|
|
36
|
+
validateSingleCommit: true
|
|
37
|
+
validateSingleCommitMatchesPrTitle: true
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches:
|
|
5
|
+
- main
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
release:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
fetch-depth: 0
|
|
18
|
+
|
|
19
|
+
- name: Setup Node
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version-file: ./.node-version
|
|
23
|
+
|
|
24
|
+
- name: Install Dependencies
|
|
25
|
+
run: npm install
|
|
26
|
+
|
|
27
|
+
- name: Release
|
|
28
|
+
run: npm run release
|
|
29
|
+
env:
|
|
30
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
31
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/.node-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
20.12.0
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# [3.0.0](https://github.com/moneyforward/eslint-config-moneyforward/compare/2.0.0...3.0.0) (2024-04-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Allow to omit importing some functions for test files written in TypeScript ([#250](https://github.com/moneyforward/eslint-config-moneyforward/issues/250)) ([7da21e3](https://github.com/moneyforward/eslint-config-moneyforward/commit/7da21e31a85d0e3d3a08e86569eb0036bbbc5fa0))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Implement CD "release" ([#255](https://github.com/moneyforward/eslint-config-moneyforward/issues/255)) ([66734d1](https://github.com/moneyforward/eslint-config-moneyforward/commit/66734d14863fd954a00cd50ba3e5082d72ecb60d))
|
|
12
|
+
* Implement config "node" ([#244](https://github.com/moneyforward/eslint-config-moneyforward/issues/244)) ([170e699](https://github.com/moneyforward/eslint-config-moneyforward/commit/170e699130abd697449c0a3ab0f6e6ec4c93f5f6))
|
|
13
|
+
* Implement config "react" ([#240](https://github.com/moneyforward/eslint-config-moneyforward/issues/240)) ([a8908d6](https://github.com/moneyforward/eslint-config-moneyforward/commit/a8908d640cb491838292a2a516fa460b289c0006))
|
|
14
|
+
* Implement config `jsdoc` ([#238](https://github.com/moneyforward/eslint-config-moneyforward/issues/238)) ([24cdd78](https://github.com/moneyforward/eslint-config-moneyforward/commit/24cdd7838b35bbcbb32548dde1bc7fefe0175076))
|
|
15
|
+
* Implement the rule "best-practices" ([#210](https://github.com/moneyforward/eslint-config-moneyforward/issues/210)) ([701a0e6](https://github.com/moneyforward/eslint-config-moneyforward/commit/701a0e68d674863759deccfcdf82a8ed80a06f66))
|
|
16
|
+
* Implement the rule "errors" ([#211](https://github.com/moneyforward/eslint-config-moneyforward/issues/211)) ([907c92a](https://github.com/moneyforward/eslint-config-moneyforward/commit/907c92a3fa6b6b5b3fdbe9202abe06a61ad5860c))
|
|
17
|
+
* Implement the rule "es6" ([#212](https://github.com/moneyforward/eslint-config-moneyforward/issues/212)) ([31e3000](https://github.com/moneyforward/eslint-config-moneyforward/commit/31e30009d6785d285aafd8e5f147c96c41abc2c1))
|
|
18
|
+
* Implement the rule "imports" ([#213](https://github.com/moneyforward/eslint-config-moneyforward/issues/213)) ([b09c196](https://github.com/moneyforward/eslint-config-moneyforward/commit/b09c196449defabf08aab30b23e5f5d5f4e7e291))
|
|
19
|
+
* Implement the rule "react-hooks" ([#226](https://github.com/moneyforward/eslint-config-moneyforward/issues/226)) ([d1e574d](https://github.com/moneyforward/eslint-config-moneyforward/commit/d1e574d216e09d7759f40aa1a69f3689f79bb276))
|
|
20
|
+
* Implement the rule "style" ([#216](https://github.com/moneyforward/eslint-config-moneyforward/issues/216)) ([6d2261d](https://github.com/moneyforward/eslint-config-moneyforward/commit/6d2261d42910c7cbc091636669d78a824960e1dd))
|
|
21
|
+
* Implement the rule "variables" ([#222](https://github.com/moneyforward/eslint-config-moneyforward/issues/222)) ([e91e5d2](https://github.com/moneyforward/eslint-config-moneyforward/commit/e91e5d244a00a9938770f1b386248e7ef47f2c42))
|
|
22
|
+
* Implement v3 config "essentials" ([#237](https://github.com/moneyforward/eslint-config-moneyforward/issues/237)) ([af7c775](https://github.com/moneyforward/eslint-config-moneyforward/commit/af7c7757ff8185942ac0ca5f606bafcd365414b4))
|
|
23
|
+
* Implement v3 config "next" ([#243](https://github.com/moneyforward/eslint-config-moneyforward/issues/243)) ([00fdb4d](https://github.com/moneyforward/eslint-config-moneyforward/commit/00fdb4d25d055a5feb18b1cd39cfef2e2babb115))
|
|
24
|
+
* Implement v3 config "storybook" ([#241](https://github.com/moneyforward/eslint-config-moneyforward/issues/241)) ([bca4534](https://github.com/moneyforward/eslint-config-moneyforward/commit/bca453402d5a88d57728ffed69bff1c5551e842b))
|
|
25
|
+
* Implement v3 config "test/react" ([#239](https://github.com/moneyforward/eslint-config-moneyforward/issues/239)) ([e488f4a](https://github.com/moneyforward/eslint-config-moneyforward/commit/e488f4a4684db27f944ce875b475ca665c1b41fc))
|
|
26
|
+
* Implement v3 config "typescript" ([#242](https://github.com/moneyforward/eslint-config-moneyforward/issues/242)) ([eb3d1e4](https://github.com/moneyforward/eslint-config-moneyforward/commit/eb3d1e4371760adbff1f9e33220c22d3750974c5))
|
|
27
|
+
* Implement v3 rule "jesdoc" ([#234](https://github.com/moneyforward/eslint-config-moneyforward/issues/234)) ([b407ee3](https://github.com/moneyforward/eslint-config-moneyforward/commit/b407ee352e32e77ad870259fa20fe5087646802d))
|
|
28
|
+
* Implement v3 rule "jest-dom" ([#231](https://github.com/moneyforward/eslint-config-moneyforward/issues/231)) ([e0891ed](https://github.com/moneyforward/eslint-config-moneyforward/commit/e0891ed1a1e0e816f881a84df94b563665e23698))
|
|
29
|
+
* Implement v3 rule "jest" ([#228](https://github.com/moneyforward/eslint-config-moneyforward/issues/228)) ([d544fa0](https://github.com/moneyforward/eslint-config-moneyforward/commit/d544fa0e6e99cd27cdad6110bec57c400d29c1c9))
|
|
30
|
+
* Implement v3 rule "next" ([#227](https://github.com/moneyforward/eslint-config-moneyforward/issues/227)) ([b1662ad](https://github.com/moneyforward/eslint-config-moneyforward/commit/b1662ad1fcaf1f18eb6cc70785e32c61986389a5))
|
|
31
|
+
* Implement v3 rule "node" ([#215](https://github.com/moneyforward/eslint-config-moneyforward/issues/215)) ([91bcb4c](https://github.com/moneyforward/eslint-config-moneyforward/commit/91bcb4c1ea1e74a66b335447225cd45f184dbd97))
|
|
32
|
+
* Implement v3 rule "promise" ([#223](https://github.com/moneyforward/eslint-config-moneyforward/issues/223)) ([b79e339](https://github.com/moneyforward/eslint-config-moneyforward/commit/b79e339d0d048b3a7d225064082acd28827be0e9))
|
|
33
|
+
* Implement v3 rule "testing-library" ([#232](https://github.com/moneyforward/eslint-config-moneyforward/issues/232)) ([6afbe8f](https://github.com/moneyforward/eslint-config-moneyforward/commit/6afbe8f010dd758ae16030d3632bb16662d44f12))
|
|
34
|
+
* Implement v3 rule "typescript" ([#236](https://github.com/moneyforward/eslint-config-moneyforward/issues/236)) ([6d42dc6](https://github.com/moneyforward/eslint-config-moneyforward/commit/6d42dc6e08af96f883a06ea484a4244984a57764))
|
|
35
|
+
* Implement v3 rule `jsx-a11y` ([#224](https://github.com/moneyforward/eslint-config-moneyforward/issues/224)) ([7fe1bd4](https://github.com/moneyforward/eslint-config-moneyforward/commit/7fe1bd495a5326eb058437b0e5118fc9a3810bdd))
|
|
36
|
+
* Implement v3 rule `react` ([#225](https://github.com/moneyforward/eslint-config-moneyforward/issues/225)) ([fe33aa2](https://github.com/moneyforward/eslint-config-moneyforward/commit/fe33aa2a34667f151b1f45aef0c899f2a7328b34))
|
|
37
|
+
* Implement v3 rule storybook ([#233](https://github.com/moneyforward/eslint-config-moneyforward/issues/233)) ([d879dc5](https://github.com/moneyforward/eslint-config-moneyforward/commit/d879dc5dbe5aa1e3678076d87dee4b990d377a52))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### BREAKING CHANGES
|
|
41
|
+
|
|
42
|
+
* * Linter rules have been significantly added and are now more strict.
|
|
43
|
+
|
|
44
|
+
* The way `eslintrc` is configured has been changed.
|
package/README.md
CHANGED
|
@@ -1,59 +1,101 @@
|
|
|
1
1
|
# eslint-config-moneyforward
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/eslint-config-moneyforward?activeTab=versions)
|
|
4
|
+
[](https://github.com/moneyforward/eslint-config-moneyforward/blob/main/LICENSE)
|
|
5
|
+
|
|
6
|
+
This package provides moneyforward's `.eslintrc` as an extensible shared config.
|
|
4
7
|
|
|
5
8
|
## Usage
|
|
6
9
|
|
|
7
|
-
|
|
10
|
+
### 1. Install dependencies (and peer dependencies)
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install --save-dev eslint-config-moneyforward eslint
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### 2. Configure ESLint
|
|
17
|
+
|
|
18
|
+
Within your ESLint config file:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"extends": ["moneyforward/essentials"]
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
If you need React Support:
|
|
27
|
+
|
|
28
|
+
```diff
|
|
29
|
+
{
|
|
30
|
+
"extends": [
|
|
31
|
+
"moneyforward/essentials",
|
|
32
|
+
+ "moneyforward/react",
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
```
|
|
8
36
|
|
|
9
|
-
|
|
37
|
+
Must be added after `essentials`.
|
|
10
38
|
|
|
11
|
-
.
|
|
39
|
+
We also provide various other rule sets that you can configure to suit your project.
|
|
12
40
|
|
|
13
41
|
```json
|
|
14
42
|
{
|
|
15
43
|
"extends": [
|
|
16
|
-
"moneyforward",
|
|
17
|
-
"moneyforward/
|
|
18
|
-
"moneyforward/
|
|
19
|
-
"moneyforward/
|
|
44
|
+
"moneyforward/essentials",
|
|
45
|
+
"moneyforward/jsdoc",
|
|
46
|
+
"moneyforward/next",
|
|
47
|
+
"moneyforward/node",
|
|
48
|
+
"moneyforward/react",
|
|
49
|
+
"moneyforward/storybook",
|
|
50
|
+
"moneyforward/test/react",
|
|
51
|
+
"moneyforward/typescript"
|
|
20
52
|
]
|
|
21
53
|
}
|
|
22
54
|
```
|
|
23
55
|
|
|
24
|
-
|
|
56
|
+
| Rule set | Summary | Dependencies |
|
|
57
|
+
| -----------: | :---------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
58
|
+
| `essentials` | Contains basic, import, and promise recommended rules | [`eslint`](https://eslint.org/) <br> [`eslint-plugin-promise`](https://github.com/eslint-community/eslint-plugin-promise) <br> [`eslint-plugin-import`](https://github.com/import-js/eslint-plugin-import) |
|
|
59
|
+
| `jsdoc` | Contains JSDoc recommended rules | [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc) |
|
|
60
|
+
| `next` | Contains Next.js recommended rules | [`eslint-plugin-next`](https://github.com/vercel/next.js/tree/canary/packages/eslint-plugin-next) |
|
|
61
|
+
| `node` | Contains Node.js recommended rules | [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n) |
|
|
62
|
+
| `react` | Contains React recommended rules | [`eslint-plugin-jsx-a11y`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y) <br> [`eslint-plugin-react-hooks`](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks) <br> [`eslint-plugin-react`](https://github.com/jsx-eslint/eslint-plugin-react) |
|
|
63
|
+
| `storybook` | Contains Storybook recommended rules | [`eslint-plugin-storybook`](https://github.com/storybookjs/eslint-plugin-storybook) |
|
|
64
|
+
| `test/react` | Contains Jest and React Testing Library rules | [`eslint-plugin-jest`](https://github.com/jest-community/eslint-plugin-jest) <br> [`eslint-plugin-testing-library`](https://github.com/testing-library/eslint-plugin-testing-library) |
|
|
65
|
+
| `typescript` | Contains TypeScript recommended rules | [`@eslint-typescript/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin) <br> [`@eslint-typescript/parser`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser) |
|
|
25
66
|
|
|
26
|
-
|
|
27
|
-
- Contains ESLint recommended rule
|
|
28
|
-
- `moneyforward/rules/node`
|
|
29
|
-
- Contains Node.js recommended rule ( `eslint-plugin-node` )
|
|
30
|
-
- `moneyforward/rules/typescript`
|
|
31
|
-
- Contains TypeScript recommended rule ( `@typescript-eslint/eslint-plugin` )
|
|
32
|
-
- `moneyforward/rules/react`
|
|
33
|
-
- Contains React recommended rule ( `eslint-plugin-react`, `eslint-plugin-react-hooks` )
|
|
34
|
-
- `moneyforward/rules/next`
|
|
35
|
-
- Contains React and Next.js recommended rule ( `eslint-plugin-react`, `eslint-plugin-react-hooks`, `eslint-plugin-next` )
|
|
36
|
-
- `moneyforward/rules/jest`
|
|
37
|
-
- Contains Jest recommended rule ( `eslint-plugin-jest` )
|
|
38
|
-
- `moneyforward/rules/testing-library/react`
|
|
39
|
-
- Contains React Testing Library recommended rule ( `eslint-plugin-testing-library`, `eslint-plugin-jest-dom` )
|
|
67
|
+
## Using Prettier
|
|
40
68
|
|
|
41
|
-
|
|
69
|
+
If you use [Prettier](https://prettier.io/) to format your code, you must disable any rules in `moneyforward/essentials` that conflict with Prettier.
|
|
42
70
|
|
|
43
|
-
|
|
71
|
+
### 1. Install dependencies
|
|
44
72
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
73
|
+
```bash
|
|
74
|
+
npm install --save-dev eslint-config-prettier
|
|
75
|
+
```
|
|
48
76
|
|
|
49
|
-
|
|
77
|
+
### 2. Configure ESLint
|
|
78
|
+
|
|
79
|
+
Within your ESLint config file:
|
|
80
|
+
|
|
81
|
+
```diff
|
|
50
82
|
{
|
|
51
|
-
"extends": [
|
|
83
|
+
"extends": [
|
|
84
|
+
"moneyforward/essentials",
|
|
85
|
+
"moneyforward/react",
|
|
86
|
+
+ "prettier"
|
|
87
|
+
]
|
|
52
88
|
}
|
|
53
89
|
```
|
|
54
90
|
|
|
91
|
+
By adding the `prettier` configuration to `extends` in the ESLint configuration, you can disable all rules in `moneyforward/essentials` that conflict with Prettier.
|
|
92
|
+
|
|
55
93
|
## Versioning
|
|
56
94
|
|
|
57
95
|
- Increment major version: Changed **error** rules.
|
|
58
96
|
- Increment minor version: Changed **warn** rules.
|
|
59
97
|
- Increment patch version: Not changed **error** and **warn** rules.
|
|
98
|
+
|
|
99
|
+
## License
|
|
100
|
+
|
|
101
|
+
Open source [licensed as MIT](https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/LICENSE).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: [
|
|
3
|
+
'../rules/best-practices',
|
|
4
|
+
'../rules/errors',
|
|
5
|
+
'../rules/es6',
|
|
6
|
+
'../rules/imports',
|
|
7
|
+
'../rules/promise',
|
|
8
|
+
'../rules/style',
|
|
9
|
+
'../rules/variables',
|
|
10
|
+
],
|
|
11
|
+
parserOptions: {
|
|
12
|
+
ecmaVersion: 12,
|
|
13
|
+
sourceType: 'module',
|
|
14
|
+
},
|
|
15
|
+
};
|
package/configs/jsdoc.js
ADDED
package/configs/next.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
require.resolve('./react'),
|
|
4
|
-
// https://github.com/vercel/next.js/blob/6f420962338fb99a377bde8e1e663bc202c95b68/packages/eslint-plugin-next/lib/index.js
|
|
5
|
-
'plugin:@next/next/recommended',
|
|
6
|
-
],
|
|
7
|
-
plugins: ['@next/next'],
|
|
2
|
+
extends: ['../rules/next'],
|
|
8
3
|
};
|
package/configs/node.js
CHANGED
package/configs/react.js
CHANGED
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
extends: [
|
|
3
|
-
// https://github.com/yannickcr/eslint-plugin-react/blob/9f1d618499b23e184a628365cb5e0ea48292cd6f/index.js
|
|
4
|
-
'plugin:react/recommended',
|
|
5
|
-
// https://github.com/facebook/react/blob/73ffce1b6fb7eff13414e35e40efe4269664e5ea/packages/eslint-plugin-react-hooks/src/index.js
|
|
6
|
-
'plugin:react-hooks/recommended',
|
|
7
|
-
],
|
|
8
|
-
plugins: ['react'],
|
|
9
|
-
parserOptions: {
|
|
10
|
-
ecmaFeatures: {
|
|
11
|
-
jsx: true,
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
rules: {
|
|
15
|
-
// don't have to use props-types
|
|
16
|
-
'react/prop-types': 'off',
|
|
17
|
-
// don't have to import React
|
|
18
|
-
'react/react-in-jsx-scope': 'off',
|
|
19
|
-
},
|
|
2
|
+
extends: ['../rules/react', '../rules/react-hooks', '../rules/jsx-a11y'],
|
|
20
3
|
settings: {
|
|
21
4
|
react: {
|
|
22
|
-
// https://github.com/yannickcr/eslint-plugin-react/issues/1955
|
|
23
5
|
version: 'detect',
|
|
24
6
|
},
|
|
25
7
|
},
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
overrides: [
|
|
3
|
+
{
|
|
4
|
+
extends: [
|
|
5
|
+
'../../rules/jest',
|
|
6
|
+
'../../rules/jest-dom',
|
|
7
|
+
'../../rules/testing-library/react',
|
|
8
|
+
],
|
|
9
|
+
files: ['**/__tests__/**/*', '**/*.{spec,test}.*'],
|
|
10
|
+
env: {
|
|
11
|
+
'jest/globals': true,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
|
+
};
|
package/configs/typescript.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
overrides: [
|
|
3
3
|
{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// https://github.com/typescript-eslint/typescript-eslint/blob/8cfe93372e1d826e54febc3aeb7047c792b90963/packages/eslint-plugin/src/configs/recommended.ts
|
|
7
|
-
'plugin:@typescript-eslint/recommended',
|
|
8
|
-
],
|
|
9
|
-
plugins: ['@typescript-eslint'],
|
|
4
|
+
extends: ['../rules/typescript'],
|
|
5
|
+
files: ['*.@(ts|tsx|cts|mts)'],
|
|
10
6
|
parser: '@typescript-eslint/parser',
|
|
11
|
-
parserOptions: {
|
|
12
|
-
sourceType: 'module',
|
|
13
|
-
},
|
|
14
7
|
},
|
|
15
8
|
],
|
|
16
9
|
};
|
package/package.json
CHANGED
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-moneyforward",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "Money Forward's ESLint rules as an extensible shared config.",
|
|
5
|
+
"exports": {
|
|
6
|
+
"./essentials": "./configs/essentials.js",
|
|
7
|
+
"./jsdoc": "./configs/jsdoc.js",
|
|
8
|
+
"./next": "./configs/next.js",
|
|
9
|
+
"./node": "./configs/node.js",
|
|
10
|
+
"./react": "./configs/react.js",
|
|
11
|
+
"./storybook": "./configs/storybook.js",
|
|
12
|
+
"./test/*": "./configs/test/*.js",
|
|
13
|
+
"./typescript": "./configs/typescript.js"
|
|
14
|
+
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">= 18.0.0"
|
|
17
|
+
},
|
|
5
18
|
"scripts": {
|
|
6
19
|
"lint": "eslint && prettier --check .",
|
|
7
20
|
"lint:fix": "eslint --fix && prettier --write .",
|
|
8
21
|
"test": "jest",
|
|
9
|
-
"release": "release
|
|
22
|
+
"release": "semantic-release"
|
|
10
23
|
},
|
|
11
24
|
"repository": {
|
|
12
25
|
"type": "git",
|
|
@@ -19,25 +32,39 @@
|
|
|
19
32
|
},
|
|
20
33
|
"homepage": "https://github.com/moneyforward/eslint-config-moneyforward#readme",
|
|
21
34
|
"dependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"@typescript-eslint/
|
|
24
|
-
"eslint
|
|
25
|
-
"
|
|
26
|
-
"eslint-plugin-
|
|
27
|
-
"eslint-plugin-
|
|
28
|
-
"eslint-plugin-
|
|
29
|
-
"eslint-plugin-
|
|
35
|
+
"@next/eslint-plugin-next": "^14.1.3",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
37
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
38
|
+
"confusing-browser-globals": "^1.0.11",
|
|
39
|
+
"eslint-plugin-import": "^2.29.1",
|
|
40
|
+
"eslint-plugin-jest": "^27.9.0",
|
|
41
|
+
"eslint-plugin-jest-dom": "^5.1.0",
|
|
42
|
+
"eslint-plugin-jsdoc": "^48.2.1",
|
|
43
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
44
|
+
"eslint-plugin-n": "^16.6.2",
|
|
45
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
46
|
+
"eslint-plugin-react": "^7.34.0",
|
|
30
47
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
31
|
-
"eslint-plugin-
|
|
48
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
49
|
+
"eslint-plugin-testing-library": "^5.11.1"
|
|
32
50
|
},
|
|
33
51
|
"devDependencies": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
52
|
+
"@semantic-release/changelog": "6.0.3",
|
|
53
|
+
"@semantic-release/git": "10.0.1",
|
|
54
|
+
"eslint": "^7.32.0 || ^8.2.0",
|
|
55
|
+
"eslint-config-prettier": "^9.1.0",
|
|
56
|
+
"jest": "^29.5.0",
|
|
57
|
+
"prettier": "^2.8.7",
|
|
58
|
+
"semantic-release": "23.0.8",
|
|
59
|
+
"typescript": ">= 4.2.4 || ^5.0.0"
|
|
38
60
|
},
|
|
39
61
|
"peerDependencies": {
|
|
40
|
-
"eslint": "
|
|
41
|
-
"typescript": ">=4"
|
|
62
|
+
"eslint": "^7.32.0 || ^8.2.0",
|
|
63
|
+
"typescript": ">= 4.2.4 || ^5.0.0"
|
|
64
|
+
},
|
|
65
|
+
"peerDependenciesMeta": {
|
|
66
|
+
"typescript": {
|
|
67
|
+
"optional": true
|
|
68
|
+
}
|
|
42
69
|
}
|
|
43
70
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @type {import('semantic-release').GlobalConfig}
|
|
3
|
+
*/
|
|
4
|
+
module.exports = {
|
|
5
|
+
branches: ['main'],
|
|
6
|
+
plugins: [
|
|
7
|
+
'@semantic-release/commit-analyzer',
|
|
8
|
+
'@semantic-release/release-notes-generator',
|
|
9
|
+
'@semantic-release/changelog',
|
|
10
|
+
'@semantic-release/npm',
|
|
11
|
+
[
|
|
12
|
+
'@semantic-release/git',
|
|
13
|
+
{
|
|
14
|
+
assets: ['CHANGELOG.md', 'package.json', 'package-lock.json'],
|
|
15
|
+
message:
|
|
16
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
17
|
+
'chore(release): ${nextRelease.version} \n\n${nextRelease.notes}',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
'@semantic-release/github',
|
|
21
|
+
],
|
|
22
|
+
// eslint-disable-next-line no-template-curly-in-string
|
|
23
|
+
tagFormat: '${version}',
|
|
24
|
+
};
|