@kurateh/eslint-config 0.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/dist/index.cjs +206 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +193 -0
- package/package.json +51 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('eslint-plugin-react');
|
|
4
|
+
var reactHooks = require('eslint-plugin-react-hooks');
|
|
5
|
+
var globals = require('globals');
|
|
6
|
+
var js = require('@eslint/js');
|
|
7
|
+
var kuratehPlugin = require('@kurateh/eslint-plugin');
|
|
8
|
+
var importPlugin = require('eslint-plugin-import');
|
|
9
|
+
var eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended');
|
|
10
|
+
var unusedImportsPlugin = require('eslint-plugin-unused-imports');
|
|
11
|
+
var tseslint = require('typescript-eslint');
|
|
12
|
+
|
|
13
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
var react__default = /*#__PURE__*/_interopDefault(react);
|
|
16
|
+
var reactHooks__default = /*#__PURE__*/_interopDefault(reactHooks);
|
|
17
|
+
var globals__default = /*#__PURE__*/_interopDefault(globals);
|
|
18
|
+
var js__default = /*#__PURE__*/_interopDefault(js);
|
|
19
|
+
var kuratehPlugin__default = /*#__PURE__*/_interopDefault(kuratehPlugin);
|
|
20
|
+
var importPlugin__default = /*#__PURE__*/_interopDefault(importPlugin);
|
|
21
|
+
var eslintPluginPrettierRecommended__default = /*#__PURE__*/_interopDefault(eslintPluginPrettierRecommended);
|
|
22
|
+
var unusedImportsPlugin__default = /*#__PURE__*/_interopDefault(unusedImportsPlugin);
|
|
23
|
+
var tseslint__default = /*#__PURE__*/_interopDefault(tseslint);
|
|
24
|
+
|
|
25
|
+
// src/configs/react.ts
|
|
26
|
+
var recommendedConfig = [
|
|
27
|
+
js__default.default.configs.recommended,
|
|
28
|
+
importPlugin__default.default.flatConfigs.recommended,
|
|
29
|
+
eslintPluginPrettierRecommended__default.default,
|
|
30
|
+
...tseslint__default.default.configs.recommended,
|
|
31
|
+
importPlugin__default.default.flatConfigs.typescript,
|
|
32
|
+
{
|
|
33
|
+
// ESLint config block에 file이 있으면 해당 파일을 검사할 차례가 와서야 plugin이 적용됨
|
|
34
|
+
// 따라서 이 Plugin을 끄려면 Config File에서 file: "~~"을 넣어야 됨
|
|
35
|
+
// 이 과정을 없애기 위해 plugin 적용을 앞서 진행
|
|
36
|
+
plugins: {
|
|
37
|
+
"@kurateh": kuratehPlugin__default.default
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
|
|
42
|
+
ignores: ["node_modules/", "dist/", "build/", "coverage/"],
|
|
43
|
+
settings: {
|
|
44
|
+
"import/resolver": {
|
|
45
|
+
typescript: {
|
|
46
|
+
alwaysTryTypes: true,
|
|
47
|
+
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
|
48
|
+
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
|
|
49
|
+
// use <root>/path/to/folder/tsconfig.json
|
|
50
|
+
project: "tsconfig.json"
|
|
51
|
+
// Multiple tsconfigs (Useful for monorepos)
|
|
52
|
+
// use a glob pattern
|
|
53
|
+
// project: "packages/*/tsconfig.json",
|
|
54
|
+
// use an array
|
|
55
|
+
// project: [
|
|
56
|
+
// "packages/module-a/tsconfig.json",
|
|
57
|
+
// "packages/module-b/tsconfig.json"
|
|
58
|
+
// ],
|
|
59
|
+
// use an array of glob patterns
|
|
60
|
+
// project: [
|
|
61
|
+
// "packages/*/tsconfig.json",
|
|
62
|
+
// "other-packages/*/
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
plugins: {
|
|
67
|
+
"unused-imports": unusedImportsPlugin__default.default
|
|
68
|
+
},
|
|
69
|
+
languageOptions: {
|
|
70
|
+
ecmaVersion: "latest",
|
|
71
|
+
sourceType: "module",
|
|
72
|
+
globals: {
|
|
73
|
+
...globals__default.default.es2017,
|
|
74
|
+
...globals__default.default.browser,
|
|
75
|
+
...globals__default.default.node
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
rules: {
|
|
79
|
+
// eslint
|
|
80
|
+
"no-console": 1,
|
|
81
|
+
"object-shorthand": 1,
|
|
82
|
+
"no-param-reassign": [
|
|
83
|
+
2,
|
|
84
|
+
{
|
|
85
|
+
props: true,
|
|
86
|
+
ignorePropertyModificationsForRegex: ["^draft$", "Draft$"]
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
camelcase: [1, { allow: ["^\\w*_[A-Z]*$"] }],
|
|
90
|
+
"no-var": 2,
|
|
91
|
+
// prettier
|
|
92
|
+
"prettier/prettier": 1,
|
|
93
|
+
// import
|
|
94
|
+
"import/no-named-as-default-member": 0,
|
|
95
|
+
"import/no-extraneous-dependencies": [
|
|
96
|
+
2,
|
|
97
|
+
{
|
|
98
|
+
devDependencies: [
|
|
99
|
+
"**/*.test.*",
|
|
100
|
+
"**/*.stories.*",
|
|
101
|
+
"**/*.config.*",
|
|
102
|
+
"**/*.spec.*"
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"import/order": [
|
|
107
|
+
1,
|
|
108
|
+
{
|
|
109
|
+
alphabetize: {
|
|
110
|
+
order: "asc",
|
|
111
|
+
caseInsensitive: true
|
|
112
|
+
},
|
|
113
|
+
"newlines-between": "always",
|
|
114
|
+
groups: [
|
|
115
|
+
"builtin",
|
|
116
|
+
"external",
|
|
117
|
+
"internal",
|
|
118
|
+
["parent", "sibling", "index"]
|
|
119
|
+
],
|
|
120
|
+
pathGroups: [
|
|
121
|
+
{
|
|
122
|
+
pattern: "~*/**",
|
|
123
|
+
group: "internal"
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
pattern: "@*/**",
|
|
127
|
+
group: "internal"
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
// unused-imports
|
|
133
|
+
"unused-imports/no-unused-imports": 2,
|
|
134
|
+
// kurateh
|
|
135
|
+
"@kurateh/import-path": 1,
|
|
136
|
+
// typescript
|
|
137
|
+
"@typescript-eslint/no-unused-vars": [
|
|
138
|
+
1,
|
|
139
|
+
{
|
|
140
|
+
ignoreRestSiblings: true,
|
|
141
|
+
vars: "all",
|
|
142
|
+
args: "after-used",
|
|
143
|
+
argsIgnorePattern: "^_",
|
|
144
|
+
varsIgnorePattern: "^_"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
148
|
+
1,
|
|
149
|
+
{
|
|
150
|
+
fixStyle: "inline-type-imports"
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"import/no-unresolved": 0
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
];
|
|
157
|
+
|
|
158
|
+
// src/configs/react.ts
|
|
159
|
+
var reactConfig = [
|
|
160
|
+
...recommendedConfig,
|
|
161
|
+
react__default.default.configs.flat.recommended,
|
|
162
|
+
reactHooks__default.default.configs.flat.recommended,
|
|
163
|
+
{
|
|
164
|
+
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
165
|
+
languageOptions: {
|
|
166
|
+
parserOptions: {
|
|
167
|
+
ecmaFeatures: {
|
|
168
|
+
jsx: true
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
globals: {
|
|
172
|
+
...globals__default.default.browser
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
rules: {
|
|
176
|
+
"react/react-in-jsx-scope": 0,
|
|
177
|
+
"react/function-component-definition": [
|
|
178
|
+
2,
|
|
179
|
+
{
|
|
180
|
+
namedComponents: "arrow-function",
|
|
181
|
+
unnamedComponents: "arrow-function"
|
|
182
|
+
}
|
|
183
|
+
],
|
|
184
|
+
"react/jsx-curly-brace-presence": [
|
|
185
|
+
1,
|
|
186
|
+
{
|
|
187
|
+
props: "never",
|
|
188
|
+
children: "never"
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
"react/prop-types": 0,
|
|
192
|
+
"react/require-default-props": 0,
|
|
193
|
+
"react/display-name": 0,
|
|
194
|
+
"react/no-children-prop": [2, { allowFunctions: true }]
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
];
|
|
198
|
+
|
|
199
|
+
// src/index.ts
|
|
200
|
+
var config = {
|
|
201
|
+
recommended: recommendedConfig,
|
|
202
|
+
react: reactConfig
|
|
203
|
+
};
|
|
204
|
+
var index_default = config;
|
|
205
|
+
|
|
206
|
+
module.exports = index_default;
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { createRequire } from 'module';
|
|
2
|
+
import react from 'eslint-plugin-react';
|
|
3
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
4
|
+
import globals from 'globals';
|
|
5
|
+
import js from '@eslint/js';
|
|
6
|
+
import kuratehPlugin from '@kurateh/eslint-plugin';
|
|
7
|
+
import importPlugin from 'eslint-plugin-import';
|
|
8
|
+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
9
|
+
import unusedImportsPlugin from 'eslint-plugin-unused-imports';
|
|
10
|
+
import tseslint from 'typescript-eslint';
|
|
11
|
+
|
|
12
|
+
createRequire(import.meta.url);
|
|
13
|
+
var recommendedConfig = [
|
|
14
|
+
js.configs.recommended,
|
|
15
|
+
importPlugin.flatConfigs.recommended,
|
|
16
|
+
eslintPluginPrettierRecommended,
|
|
17
|
+
...tseslint.configs.recommended,
|
|
18
|
+
importPlugin.flatConfigs.typescript,
|
|
19
|
+
{
|
|
20
|
+
// ESLint config block에 file이 있으면 해당 파일을 검사할 차례가 와서야 plugin이 적용됨
|
|
21
|
+
// 따라서 이 Plugin을 끄려면 Config File에서 file: "~~"을 넣어야 됨
|
|
22
|
+
// 이 과정을 없애기 위해 plugin 적용을 앞서 진행
|
|
23
|
+
plugins: {
|
|
24
|
+
"@kurateh": kuratehPlugin
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
files: ["**/*.ts", "**/*.tsx", "**/*.mts", "**/*.cts"],
|
|
29
|
+
ignores: ["node_modules/", "dist/", "build/", "coverage/"],
|
|
30
|
+
settings: {
|
|
31
|
+
"import/resolver": {
|
|
32
|
+
typescript: {
|
|
33
|
+
alwaysTryTypes: true,
|
|
34
|
+
// always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
|
|
35
|
+
// Choose from one of the "project" configs below or omit to use <root>/tsconfig.json by default
|
|
36
|
+
// use <root>/path/to/folder/tsconfig.json
|
|
37
|
+
project: "tsconfig.json"
|
|
38
|
+
// Multiple tsconfigs (Useful for monorepos)
|
|
39
|
+
// use a glob pattern
|
|
40
|
+
// project: "packages/*/tsconfig.json",
|
|
41
|
+
// use an array
|
|
42
|
+
// project: [
|
|
43
|
+
// "packages/module-a/tsconfig.json",
|
|
44
|
+
// "packages/module-b/tsconfig.json"
|
|
45
|
+
// ],
|
|
46
|
+
// use an array of glob patterns
|
|
47
|
+
// project: [
|
|
48
|
+
// "packages/*/tsconfig.json",
|
|
49
|
+
// "other-packages/*/
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
plugins: {
|
|
54
|
+
"unused-imports": unusedImportsPlugin
|
|
55
|
+
},
|
|
56
|
+
languageOptions: {
|
|
57
|
+
ecmaVersion: "latest",
|
|
58
|
+
sourceType: "module",
|
|
59
|
+
globals: {
|
|
60
|
+
...globals.es2017,
|
|
61
|
+
...globals.browser,
|
|
62
|
+
...globals.node
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
rules: {
|
|
66
|
+
// eslint
|
|
67
|
+
"no-console": 1,
|
|
68
|
+
"object-shorthand": 1,
|
|
69
|
+
"no-param-reassign": [
|
|
70
|
+
2,
|
|
71
|
+
{
|
|
72
|
+
props: true,
|
|
73
|
+
ignorePropertyModificationsForRegex: ["^draft$", "Draft$"]
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
camelcase: [1, { allow: ["^\\w*_[A-Z]*$"] }],
|
|
77
|
+
"no-var": 2,
|
|
78
|
+
// prettier
|
|
79
|
+
"prettier/prettier": 1,
|
|
80
|
+
// import
|
|
81
|
+
"import/no-named-as-default-member": 0,
|
|
82
|
+
"import/no-extraneous-dependencies": [
|
|
83
|
+
2,
|
|
84
|
+
{
|
|
85
|
+
devDependencies: [
|
|
86
|
+
"**/*.test.*",
|
|
87
|
+
"**/*.stories.*",
|
|
88
|
+
"**/*.config.*",
|
|
89
|
+
"**/*.spec.*"
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"import/order": [
|
|
94
|
+
1,
|
|
95
|
+
{
|
|
96
|
+
alphabetize: {
|
|
97
|
+
order: "asc",
|
|
98
|
+
caseInsensitive: true
|
|
99
|
+
},
|
|
100
|
+
"newlines-between": "always",
|
|
101
|
+
groups: [
|
|
102
|
+
"builtin",
|
|
103
|
+
"external",
|
|
104
|
+
"internal",
|
|
105
|
+
["parent", "sibling", "index"]
|
|
106
|
+
],
|
|
107
|
+
pathGroups: [
|
|
108
|
+
{
|
|
109
|
+
pattern: "~*/**",
|
|
110
|
+
group: "internal"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
pattern: "@*/**",
|
|
114
|
+
group: "internal"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
// unused-imports
|
|
120
|
+
"unused-imports/no-unused-imports": 2,
|
|
121
|
+
// kurateh
|
|
122
|
+
"@kurateh/import-path": 1,
|
|
123
|
+
// typescript
|
|
124
|
+
"@typescript-eslint/no-unused-vars": [
|
|
125
|
+
1,
|
|
126
|
+
{
|
|
127
|
+
ignoreRestSiblings: true,
|
|
128
|
+
vars: "all",
|
|
129
|
+
args: "after-used",
|
|
130
|
+
argsIgnorePattern: "^_",
|
|
131
|
+
varsIgnorePattern: "^_"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
135
|
+
1,
|
|
136
|
+
{
|
|
137
|
+
fixStyle: "inline-type-imports"
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
"import/no-unresolved": 0
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
];
|
|
144
|
+
|
|
145
|
+
// src/configs/react.ts
|
|
146
|
+
var reactConfig = [
|
|
147
|
+
...recommendedConfig,
|
|
148
|
+
react.configs.flat.recommended,
|
|
149
|
+
reactHooks.configs.flat.recommended,
|
|
150
|
+
{
|
|
151
|
+
files: ["**/*.{js,jsx,mjs,cjs,ts,tsx}"],
|
|
152
|
+
languageOptions: {
|
|
153
|
+
parserOptions: {
|
|
154
|
+
ecmaFeatures: {
|
|
155
|
+
jsx: true
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
globals: {
|
|
159
|
+
...globals.browser
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
rules: {
|
|
163
|
+
"react/react-in-jsx-scope": 0,
|
|
164
|
+
"react/function-component-definition": [
|
|
165
|
+
2,
|
|
166
|
+
{
|
|
167
|
+
namedComponents: "arrow-function",
|
|
168
|
+
unnamedComponents: "arrow-function"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"react/jsx-curly-brace-presence": [
|
|
172
|
+
1,
|
|
173
|
+
{
|
|
174
|
+
props: "never",
|
|
175
|
+
children: "never"
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"react/prop-types": 0,
|
|
179
|
+
"react/require-default-props": 0,
|
|
180
|
+
"react/display-name": 0,
|
|
181
|
+
"react/no-children-prop": [2, { allowFunctions: true }]
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
];
|
|
185
|
+
|
|
186
|
+
// src/index.ts
|
|
187
|
+
var config = {
|
|
188
|
+
recommended: recommendedConfig,
|
|
189
|
+
react: reactConfig
|
|
190
|
+
};
|
|
191
|
+
var index_default = config;
|
|
192
|
+
|
|
193
|
+
export { index_default as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kurateh/eslint-config",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"require": "./dist/index.cjs"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [],
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "kurateh",
|
|
18
|
+
"email": "me@kurateh.com"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"url": "https://github.com/kurateh/eslint-plugin"
|
|
22
|
+
},
|
|
23
|
+
"license": "ISC",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@eslint/js": "^10.0.1",
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^8.59.0",
|
|
27
|
+
"@typescript-eslint/parser": "^8.59.0",
|
|
28
|
+
"@typescript-eslint/utils": "^8.59.0",
|
|
29
|
+
"eslint-config-prettier": "^10.1.8",
|
|
30
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
31
|
+
"eslint-plugin-import": "^2.32.0",
|
|
32
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
33
|
+
"eslint-plugin-react": "^7.37.5",
|
|
34
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
35
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
36
|
+
"globals": "^17.5.0",
|
|
37
|
+
"typescript-eslint": "^8.59.0",
|
|
38
|
+
"@kurateh/eslint-plugin": "0.0.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@kurateh/oxlint-config": "0.0.0"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"eslint": ">=9"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsup",
|
|
48
|
+
"format": "prettier --write .",
|
|
49
|
+
"format:check": "prettier --check ."
|
|
50
|
+
}
|
|
51
|
+
}
|