Skip to content

Commit 4bfef35

Browse files
add partition by new line
1 parent f7749e6 commit 4bfef35

3 files changed

Lines changed: 130 additions & 150 deletions

File tree

packages/eslint-config/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @molao-ui/eslint-config
22

3+
## 4.0.6
4+
5+
### Patch Changes
6+
7+
- add partition by new line
8+
39
## 4.0.5
410

511
### Patch Changes

packages/eslint-config/index.js

Lines changed: 123 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,199 +1,173 @@
11
module.exports = {
2-
parser: "@typescript-eslint/parser",
2+
parser: '@typescript-eslint/parser',
33
extends: [
4-
"plugin:react/recommended",
5-
"prettier",
6-
"plugin:prettier/recommended",
7-
"plugin:tailwindcss/recommended",
8-
"plugin:@tanstack/eslint-plugin-query/recommended",
9-
],
10-
plugins: [
11-
"react",
12-
"import-helpers",
13-
"react-hooks",
14-
"perfectionist",
15-
"@tanstack/query",
16-
"jest-formatting",
17-
"jest",
4+
'plugin:react/recommended',
5+
'prettier',
6+
'plugin:prettier/recommended',
7+
'plugin:tailwindcss/recommended',
8+
'plugin:@tanstack/eslint-plugin-query/recommended'
189
],
10+
plugins: ['react', 'import-helpers', 'react-hooks', 'perfectionist', '@tanstack/query', 'jest-formatting', 'jest'],
1911
overrides: [
2012
{
2113
env: {
22-
node: true,
14+
node: true
2315
},
24-
files: ["*.ts", "*.tsx"],
16+
files: ['*.ts', '*.tsx'],
2517
extends: [
26-
"plugin:@typescript-eslint/recommended",
18+
'plugin:@typescript-eslint/recommended'
2719
// 'plugin:@typescript-eslint/recommended-requiring-type-checking',
2820
],
2921
parserOptions: {
30-
project: ["./tsconfig.json"],
31-
},
32-
},
22+
project: ['./tsconfig.json']
23+
}
24+
}
3325
],
3426
rules: {
35-
"no-console": "warn",
36-
"linebreak-style": "off",
27+
'no-console': 'warn',
28+
'linebreak-style': 'off',
3729

38-
"@typescript-eslint/no-unused-vars": "error",
39-
"@typescript-eslint/unbound-method": "off",
40-
"@typescript-eslint/no-empty-function": "off",
41-
"@typescript-eslint/consistent-type-imports": "off",
42-
"@typescript-eslint/no-confusing-void-expression": "off",
43-
"@typescript-eslint/explicit-function-return-type": "off",
44-
"@typescript-eslint/strict-boolean-expressions": "off",
45-
"@typescript-eslint/no-empty-function": "off",
46-
"@typescript-eslint/no-misused-promises": "off",
47-
"@typescript-eslint/no-floating-promises": "off",
48-
"@typescript-eslint/no-empty-function": "off",
30+
'@typescript-eslint/no-unused-vars': 'error',
31+
'@typescript-eslint/unbound-method': 'off',
32+
'@typescript-eslint/no-empty-function': 'off',
33+
'@typescript-eslint/consistent-type-imports': 'off',
34+
'@typescript-eslint/no-confusing-void-expression': 'off',
35+
'@typescript-eslint/explicit-function-return-type': 'off',
36+
'@typescript-eslint/strict-boolean-expressions': 'off',
37+
'@typescript-eslint/no-empty-function': 'off',
38+
'@typescript-eslint/no-misused-promises': 'off',
39+
'@typescript-eslint/no-floating-promises': 'off',
40+
'@typescript-eslint/no-empty-function': 'off',
4941

50-
"react/react-in-jsx-scope": "off",
42+
'react/react-in-jsx-scope': 'off',
5143

52-
"react-hooks/rules-of-hooks": "error",
53-
"react-hooks/exhaustive-deps": "warn",
44+
'react-hooks/rules-of-hooks': 'error',
45+
'react-hooks/exhaustive-deps': 'warn',
5446

55-
"tailwindcss/no-custom-classname": "off",
47+
'tailwindcss/no-custom-classname': 'off',
5648

57-
"jest/valid-title": "error",
58-
"jest/valid-expect": "error",
59-
"jest/no-disabled-tests": "warn",
60-
"jest/no-duplicate-hooks": "error",
61-
"jest/no-identical-title": "error",
62-
"jest-formatting/padding-around-all": 2,
63-
"jest/require-top-level-describe": "error",
64-
"jest/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
49+
'jest/valid-title': 'error',
50+
'jest/valid-expect': 'error',
51+
'jest/no-disabled-tests': 'warn',
52+
'jest/no-duplicate-hooks': 'error',
53+
'jest/no-identical-title': 'error',
54+
'jest-formatting/padding-around-all': 2,
55+
'jest/require-top-level-describe': 'error',
56+
'jest/consistent-test-it': ['error', { fn: 'it', withinDescribe: 'it' }],
6557

66-
"prettier/prettier": [
67-
"error",
58+
'prettier/prettier': [
59+
'error',
6860
{
69-
endOfLine: "auto",
70-
},
61+
endOfLine: 'auto'
62+
}
7163
],
7264

73-
// "import-helpers/order-imports": [
74-
// "warn",
75-
// {
76-
// newlinesBetween: "always",
77-
// groups: [
78-
// ["/^react/", "module"],
79-
// "/^~/",
80-
// ["parent", "sibling", "index"],
81-
// ],
82-
// alphabetize: { order: "ignore", ignoreCase: true },
83-
// },
84-
// ],
85-
86-
"perfectionist/sort-object-types": [
87-
"error",
65+
'perfectionist/sort-object-types': [
66+
'error',
8867
{
89-
type: "line-length",
90-
order: "asc",
91-
},
68+
type: 'line-length',
69+
order: 'asc'
70+
}
9271
],
93-
"perfectionist/sort-array-includes": [
94-
"error",
72+
'perfectionist/sort-array-includes': [
73+
'error',
9574
{
96-
type: "line-length",
97-
order: "asc",
98-
},
75+
type: 'line-length',
76+
order: 'asc'
77+
}
9978
],
100-
"perfectionist/sort-classes": [
101-
"error",
79+
'perfectionist/sort-classes': [
80+
'error',
10281
{
103-
type: "line-length",
104-
order: "asc",
105-
},
82+
type: 'line-length',
83+
order: 'asc'
84+
}
10685
],
107-
"perfectionist/sort-enums": [
108-
"error",
86+
'perfectionist/sort-enums': [
87+
'error',
10988
{
110-
type: "line-length",
111-
order: "asc",
112-
},
89+
type: 'line-length',
90+
order: 'asc'
91+
}
11392
],
114-
"perfectionist/sort-exports": [
115-
"error",
93+
'perfectionist/sort-exports': [
94+
'error',
11695
{
117-
type: "line-length",
118-
order: "asc",
119-
},
96+
type: 'line-length',
97+
order: 'asc'
98+
}
12099
],
121-
"perfectionist/sort-interfaces": [
122-
"error",
100+
'perfectionist/sort-interfaces': [
101+
'error',
123102
{
124-
type: "line-length",
125-
order: "asc",
126-
},
103+
type: 'line-length',
104+
order: 'asc',
105+
'partition-by-new-line': true
106+
}
127107
],
128-
"perfectionist/sort-jsx-props": [
129-
"error",
108+
'perfectionist/sort-jsx-props': [
109+
'error',
130110
{
131-
type: "line-length",
132-
order: "asc",
133-
},
111+
type: 'line-length',
112+
order: 'asc'
113+
}
134114
],
135-
"perfectionist/sort-map-elements": [
136-
"error",
115+
'perfectionist/sort-map-elements': [
116+
'error',
137117
{
138-
type: "line-length",
139-
order: "asc",
140-
},
118+
type: 'line-length',
119+
order: 'asc'
120+
}
141121
],
142-
"perfectionist/sort-named-exports": [
143-
"error",
122+
'perfectionist/sort-named-exports': [
123+
'error',
144124
{
145-
type: "line-length",
146-
order: "asc",
147-
},
125+
type: 'line-length',
126+
order: 'asc'
127+
}
148128
],
149-
"perfectionist/sort-named-imports": [
150-
"error",
129+
'perfectionist/sort-named-imports': [
130+
'error',
151131
{
152-
type: "line-length",
153-
order: "asc",
154-
},
132+
type: 'line-length',
133+
order: 'asc'
134+
}
155135
],
156-
"perfectionist/sort-imports": [
157-
"error",
136+
'perfectionist/sort-imports': [
137+
'error',
158138
{
159-
type: "line-length",
160-
order: "asc",
139+
type: 'line-length',
140+
order: 'asc',
161141
groups: [
162-
["type", "builtin", "external", "unknown"],
163-
["internal-type", "internal"],
164-
[
165-
"parent-type",
166-
"sibling-type",
167-
"index-type",
168-
"parent",
169-
"sibling",
170-
"index",
171-
"object",
172-
],
173-
],
174-
},
142+
['type', 'builtin', 'external', 'unknown'],
143+
['internal-type', 'internal'],
144+
['parent-type', 'sibling-type', 'index-type', 'parent', 'sibling', 'index', 'object']
145+
]
146+
}
175147
],
176-
"perfectionist/sort-object-types": [
177-
"error",
148+
'perfectionist/sort-object-types': [
149+
'error',
178150
{
179-
type: "line-length",
180-
order: "asc",
181-
},
151+
type: 'line-length',
152+
order: 'asc',
153+
'partition-by-new-line': true
154+
}
182155
],
183-
"perfectionist/sort-objects": [
184-
"error",
156+
'perfectionist/sort-objects': [
157+
'error',
185158
{
186-
type: "line-length",
187-
order: "asc",
188-
"partition-by-comment": true,
189-
},
159+
type: 'line-length',
160+
order: 'asc',
161+
'partition-by-comment': true,
162+
'partition-by-new-line': true
163+
}
190164
],
191-
"perfectionist/sort-union-types": [
192-
"error",
165+
'perfectionist/sort-union-types': [
166+
'error',
193167
{
194-
type: "line-length",
195-
order: "asc",
196-
},
197-
],
198-
},
199-
};
168+
type: 'line-length',
169+
order: 'asc'
170+
}
171+
]
172+
}
173+
}

packages/eslint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@
2222
"license": "ISC",
2323
"main": "index.js",
2424
"name": "@molao-ui/eslint-config",
25-
"version": "4.0.5"
25+
"version": "4.0.6"
2626
}

0 commit comments

Comments
 (0)