@hyeon/linter 7.0.18
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 +18 -0
- package/package.json +69 -0
- package/src/base.mjs +43 -0
- package/src/hansanghyeon.js +16 -0
- package/src/index.mjs +13 -0
- package/src/prettier.mjs +44 -0
- package/src/react.mjs +37 -0
- package/src/typescript.mjs +18 -0
package/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
## Installation
|
|
2
|
+
|
|
3
|
+
```bash
|
|
4
|
+
npm install --save-dev @hyeon/eslint-config
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```js
|
|
10
|
+
import hyeonEslintConfig from '@hyeon/eslint-config'
|
|
11
|
+
|
|
12
|
+
export default [
|
|
13
|
+
...hyeonEslintConfig.recommended,
|
|
14
|
+
...hyeonEslintConfig.react,
|
|
15
|
+
...hyeonEslintConfig.prettier,
|
|
16
|
+
...hyeonEslintConfig.typescript,
|
|
17
|
+
]
|
|
18
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hyeon/linter",
|
|
3
|
+
"version": "7.0.18",
|
|
4
|
+
"description": "Hansanghyun custom eslint settings",
|
|
5
|
+
"main": "./src/index.mjs",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"lint": "eslint . --config=eslintrc.json",
|
|
8
|
+
"test": "npm run lint && tape test/*.js",
|
|
9
|
+
"postpublish": "make postpublish"
|
|
10
|
+
},
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/hansanghyeon/linter.git"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"eslint",
|
|
17
|
+
"eslintconfig",
|
|
18
|
+
"hyeon",
|
|
19
|
+
"javascript",
|
|
20
|
+
"react",
|
|
21
|
+
"nextjs",
|
|
22
|
+
"typescript",
|
|
23
|
+
"prettier"
|
|
24
|
+
],
|
|
25
|
+
"author": "hyeon",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"bugs": {
|
|
28
|
+
"url": "https://github.com/hansanghyeon/linter/issues"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/hansanghyeon/linter#readme",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
|
33
|
+
"@typescript-eslint/parser": "^8.16.0",
|
|
34
|
+
"eslint-config-prettier": "^9.1.0",
|
|
35
|
+
"eslint-plugin-import": "^2.31.0",
|
|
36
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
37
|
+
"eslint-plugin-react": "^7.37.2",
|
|
38
|
+
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
39
|
+
"typescript-eslint": "^8.16.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"eslint": "^9.5.0",
|
|
43
|
+
"prettier": "^3.4.0"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@actions/exec": "^1.1.1",
|
|
47
|
+
"@changesets/cli": "^2.26.2",
|
|
48
|
+
"semver": "^7.5.4"
|
|
49
|
+
},
|
|
50
|
+
"exports": {
|
|
51
|
+
".": "./src/index.mjs",
|
|
52
|
+
"./recommended": "./src/base.mjs",
|
|
53
|
+
"./typescript": "./src/typescript.mjs",
|
|
54
|
+
"./react": "./src/react.mjs",
|
|
55
|
+
"./prettier": "./src/prettier.mjs",
|
|
56
|
+
"./hansanghyeon": "./src/hansanghyeon.mjs",
|
|
57
|
+
"./package.json": "./package.json"
|
|
58
|
+
},
|
|
59
|
+
"files": [
|
|
60
|
+
"typescript",
|
|
61
|
+
"react",
|
|
62
|
+
"prettier",
|
|
63
|
+
"src"
|
|
64
|
+
],
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"registry": "https://registry.npmjs.org/",
|
|
67
|
+
"access": "public"
|
|
68
|
+
}
|
|
69
|
+
}
|
package/src/base.mjs
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import simpleImportSort from "eslint-plugin-simple-import-sort";
|
|
3
|
+
import importPlugin from 'eslint-plugin-import';
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
js.configs.recommended,
|
|
7
|
+
importPlugin.flatConfigs.recommended,
|
|
8
|
+
{
|
|
9
|
+
rules: {
|
|
10
|
+
camelcase: [
|
|
11
|
+
'error',
|
|
12
|
+
{
|
|
13
|
+
properties: 'never',
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
'class-methods-use-this': 'off',
|
|
17
|
+
// tailwindcss를 사용하기때문에 최대길이 제한은 제거함
|
|
18
|
+
// 'max-len': [
|
|
19
|
+
// 'warn',
|
|
20
|
+
// 120,
|
|
21
|
+
// ],
|
|
22
|
+
'no-multi-spaces': [
|
|
23
|
+
'error',
|
|
24
|
+
{
|
|
25
|
+
ignoreEOLComments: true,
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
plugins: {
|
|
32
|
+
"simple-import-sort": simpleImportSort,
|
|
33
|
+
},
|
|
34
|
+
rules: {
|
|
35
|
+
"simple-import-sort/imports": "error",
|
|
36
|
+
"simple-import-sort/exports": "error",
|
|
37
|
+
"import/first": "error",
|
|
38
|
+
"import/newline-after-import": "error",
|
|
39
|
+
"import/no-duplicates": "error",
|
|
40
|
+
"import/no-unresolved": "off"
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
];
|
package/src/index.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import hyeonEslintConfigBase from './base.mjs'
|
|
2
|
+
import hyeonEslintConfigPrettier from './prettier.mjs'
|
|
3
|
+
import hyeonEslintConfigReact from './react.mjs'
|
|
4
|
+
import hyeonEslintConfigTypescript from './typescript.mjs'
|
|
5
|
+
import hyeonEslintConfigHansanghyeon from './hansanghyeon.mjs'
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
recommended: hyeonEslintConfigBase,
|
|
9
|
+
prettier: hyeonEslintConfigPrettier,
|
|
10
|
+
react: hyeonEslintConfigReact,
|
|
11
|
+
typescript: hyeonEslintConfigTypescript,
|
|
12
|
+
hansanghyeon: hyeonEslintConfigHansanghyeon,
|
|
13
|
+
}
|
package/src/prettier.mjs
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
eslintConfigPrettier,
|
|
6
|
+
{
|
|
7
|
+
...eslintPluginPrettierRecommended,
|
|
8
|
+
rules: {
|
|
9
|
+
"prettier/prettier": ["error", {
|
|
10
|
+
trailingComma: "all",
|
|
11
|
+
singleQuote: true,
|
|
12
|
+
semi: false,
|
|
13
|
+
tabWidth: 2,
|
|
14
|
+
arrowParens: "always",
|
|
15
|
+
jsxSingleQuote: false
|
|
16
|
+
}],
|
|
17
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
18
|
+
'prefer-arrow-callback': 'error',
|
|
19
|
+
curly: ['error', 'all'],
|
|
20
|
+
'lines-around-comment': ['error', {
|
|
21
|
+
beforeBlockComment: true,
|
|
22
|
+
afterBlockComment: true,
|
|
23
|
+
beforeLineComment: true,
|
|
24
|
+
afterLineComment: true,
|
|
25
|
+
allowBlockStart: true,
|
|
26
|
+
allowBlockEnd: true,
|
|
27
|
+
allowObjectStart: true,
|
|
28
|
+
allowObjectEnd: true,
|
|
29
|
+
allowArrayStart: true,
|
|
30
|
+
allowArrayEnd: true,
|
|
31
|
+
}],
|
|
32
|
+
'max-len': 'off',
|
|
33
|
+
'no-confusing-arrow': ['error', {
|
|
34
|
+
allowParens: false,
|
|
35
|
+
}],
|
|
36
|
+
'no-mixed-operators': 'error',
|
|
37
|
+
'no-tabs': 'error',
|
|
38
|
+
quotes: ['error', 'single', {
|
|
39
|
+
avoidEscape: true,
|
|
40
|
+
allowTemplateLiterals: false,
|
|
41
|
+
}],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
]
|
package/src/react.mjs
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import react from 'eslint-plugin-react'
|
|
2
|
+
import reactJsxruntime from 'eslint-plugin-react/configs/jsx-runtime.js'
|
|
3
|
+
import typescriptEslint from '@typescript-eslint/eslint-plugin'
|
|
4
|
+
import typescriptParser from '@typescript-eslint/parser'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
{
|
|
9
|
+
files: ['**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}'],
|
|
10
|
+
...reactJsxruntime,
|
|
11
|
+
languageOptions: {
|
|
12
|
+
...reactJsxruntime.languageOptions,
|
|
13
|
+
ecmaVersion: 'latest',
|
|
14
|
+
sourceType: 'module',
|
|
15
|
+
parser: typescriptParser,
|
|
16
|
+
parserOptions: {
|
|
17
|
+
ecmaFeatures: {
|
|
18
|
+
jsx: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
plugins: {
|
|
23
|
+
react,
|
|
24
|
+
"@typescript-eslint": typescriptEslint,
|
|
25
|
+
},
|
|
26
|
+
rules: {
|
|
27
|
+
'react/jsx-filename-extension': [
|
|
28
|
+
1,
|
|
29
|
+
{
|
|
30
|
+
extensions: ['.jsx', '.tsx'],
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
'react/prop-types': 'off',
|
|
34
|
+
'react/require-default-props': 'off',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import tseslint from 'typescript-eslint'
|
|
2
|
+
import typescriptEslint from '@typescript-eslint/eslint-plugin'
|
|
3
|
+
import typescriptParser from '@typescript-eslint/parser'
|
|
4
|
+
|
|
5
|
+
export default tseslint.config(
|
|
6
|
+
...tseslint.configs.recommended,
|
|
7
|
+
{
|
|
8
|
+
files: ['**/*.{ts,tsx,mtsx}'],
|
|
9
|
+
languageOptions: {
|
|
10
|
+
ecmaVersion: 'latest',
|
|
11
|
+
sourceType: 'module',
|
|
12
|
+
parser: typescriptParser,
|
|
13
|
+
},
|
|
14
|
+
plugins: {
|
|
15
|
+
"@typescript-eslint": typescriptEslint,
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
);
|