eslint-config-moneyforward 4.0.0 → 4.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/README.md +1 -0
- package/configs/flat/essentials.mjs +11 -0
- package/package.json +5 -4
- package/rules/imports.js +3 -3
- package/rules/react.js +7 -1
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @ts-check
|
|
2
|
+
import globals from 'globals';
|
|
2
3
|
// @ts-ignore
|
|
3
4
|
import importPlugin from 'eslint-plugin-import';
|
|
4
5
|
import promisePlugin from 'eslint-plugin-promise';
|
|
@@ -33,6 +34,16 @@ const promiseRuleSet = {
|
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
export default [
|
|
37
|
+
{
|
|
38
|
+
languageOptions: {
|
|
39
|
+
parserOptions: {
|
|
40
|
+
ecmaVersion: 'latest',
|
|
41
|
+
sourceType: 'module',
|
|
42
|
+
},
|
|
43
|
+
globals: globals.builtin,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
|
|
36
47
|
bestPracticesRuleSet,
|
|
37
48
|
errorsRuleSet,
|
|
38
49
|
es6RuleSet,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-moneyforward",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Money Forward's ESLint rules as an extensible shared config.",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./flat": {
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
"eslint-plugin-react": "^7.34.0",
|
|
55
55
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
56
56
|
"eslint-plugin-storybook": "^0.8.0",
|
|
57
|
-
"eslint-plugin-testing-library": "^6.2.2"
|
|
57
|
+
"eslint-plugin-testing-library": "^6.2.2",
|
|
58
|
+
"globals": "^15.9.0"
|
|
58
59
|
},
|
|
59
60
|
"devDependencies": {
|
|
60
61
|
"@semantic-release/changelog": "6.0.3",
|
|
@@ -62,10 +63,10 @@
|
|
|
62
63
|
"eslint": "8.57.0",
|
|
63
64
|
"eslint-config-prettier": "9.1.0",
|
|
64
65
|
"jest": "29.7.0",
|
|
65
|
-
"prettier": "3.
|
|
66
|
+
"prettier": "3.3.3",
|
|
66
67
|
"prettier-plugin-organize-imports": "3.2.4",
|
|
67
68
|
"semantic-release": "23.1.1",
|
|
68
|
-
"typescript": "5.4
|
|
69
|
+
"typescript": "5.5.4"
|
|
69
70
|
},
|
|
70
71
|
"peerDependencies": {
|
|
71
72
|
"eslint": "^8.56.0",
|
package/rules/imports.js
CHANGED
|
@@ -18,13 +18,13 @@ module.exports = {
|
|
|
18
18
|
settings: {
|
|
19
19
|
'import/resolver': {
|
|
20
20
|
node: {
|
|
21
|
-
extensions: ['.js', '.mjs', '.
|
|
21
|
+
extensions: ['.js', '.mjs', '.jsx', '.ts', '.mts', '.tsx'],
|
|
22
22
|
},
|
|
23
23
|
// Resolve the problem of incorrect recognition of alias paths by TypeScript compiler options.
|
|
24
24
|
// https://github.com/import-js/eslint-plugin-import/issues/1485#issuecomment-535351922
|
|
25
25
|
typescript: {},
|
|
26
26
|
},
|
|
27
|
-
'import/extensions': ['.js', '.mjs', '.jsx'],
|
|
27
|
+
'import/extensions': ['.js', '.mjs', '.jsx', '.ts', '.mts', '.tsx'],
|
|
28
28
|
'import/core-modules': [],
|
|
29
29
|
'import/ignore': [
|
|
30
30
|
'node_modules',
|
|
@@ -33,7 +33,7 @@ module.exports = {
|
|
|
33
33
|
// TODO: Remove this once eslint-plugin-import supports Flat Config completely.
|
|
34
34
|
// https://github.com/import-js/eslint-plugin-import/issues/2556#issuecomment-1419518561
|
|
35
35
|
'import/parsers': {
|
|
36
|
-
espree: ['.js', '
|
|
36
|
+
espree: ['.js', 'cjs', '.mjs', '.jsx'],
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
|
package/rules/react.js
CHANGED
|
@@ -96,7 +96,13 @@ module.exports = {
|
|
|
96
96
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md
|
|
97
97
|
'react/jsx-pascal-case': ['error', { allowAllCaps: true }],
|
|
98
98
|
|
|
99
|
-
// Enforce props
|
|
99
|
+
// Enforce props sorting
|
|
100
|
+
// The order of props is as follows:
|
|
101
|
+
// 1. React reserved props: e.g. key, ref
|
|
102
|
+
// 2. Shorthand props: e.g. disabled
|
|
103
|
+
// 3. Others
|
|
104
|
+
// 4. Callbacks e.g. onClick
|
|
105
|
+
// The props will no be sorted alphabetically.
|
|
100
106
|
// https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
|
|
101
107
|
'react/jsx-sort-props': [
|
|
102
108
|
'error',
|