@shakuroinc/eslint-config-react 6.0.2 → 6.0.3

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 CHANGED
@@ -13,9 +13,11 @@ module.exports = {
13
13
 
14
14
  extends: [
15
15
  'plugin:@typescript-eslint/recommended',
16
- 'plugin:react/recommended',
17
- 'plugin:prettier/recommended',
16
+ 'plugin:import/recommended',
17
+ 'plugin:import/typescript',
18
18
  'plugin:jsx-a11y/recommended',
19
+ 'plugin:prettier/recommended',
20
+ 'plugin:react/recommended',
19
21
  ],
20
22
 
21
23
  parserOptions: {
@@ -26,7 +28,109 @@ module.exports = {
26
28
  },
27
29
  },
28
30
 
31
+ settings: {
32
+ react: {
33
+ version: 'detect',
34
+ },
35
+ tailwindcss: {
36
+ officialSorting: true,
37
+ },
38
+ },
39
+
29
40
  rules: {
41
+ '@typescript-eslint/ban-ts-ignore': 0,
42
+ '@typescript-eslint/explicit-function-return-type': 0,
43
+ '@typescript-eslint/explicit-member-accessibility': 0,
44
+ '@typescript-eslint/explicit-module-boundary-types': 0,
45
+ '@typescript-eslint/interface-name-prefix': 0,
46
+ '@typescript-eslint/naming-convention': [
47
+ 'error',
48
+ {
49
+ selector: 'default',
50
+ format: ['PascalCase', 'camelCase'],
51
+ leadingUnderscore: 'forbid',
52
+ trailingUnderscore: 'forbid',
53
+ },
54
+ {
55
+ selector: ['variable', 'property'],
56
+ format: ['PascalCase', 'camelCase', 'UPPER_CASE'],
57
+ leadingUnderscore: 'forbid',
58
+ trailingUnderscore: 'forbid',
59
+ },
60
+ {
61
+ selector: 'typeLike',
62
+ format: ['PascalCase'],
63
+ },
64
+ {
65
+ selector: ['enumMember', 'enum'],
66
+ format: ['camelCase', 'UPPER_CASE', 'snake_case', 'PascalCase'],
67
+ },
68
+ {
69
+ selector: 'property',
70
+ filter: '^__html$',
71
+ format: null,
72
+ },
73
+ ],
74
+ '@typescript-eslint/no-empty-function': 0,
75
+ '@typescript-eslint/no-explicit-any': 0,
76
+ '@typescript-eslint/no-object-literal-type-assertion': 0,
77
+ '@typescript-eslint/padding-line-between-statements': [
78
+ 'error',
79
+ {
80
+ blankLine: 'always',
81
+ prev: ['interface', 'type'],
82
+ next: '*',
83
+ },
84
+ { blankLine: 'always', prev: '*', next: ['return'] },
85
+ { blankLine: 'always', prev: 'function', next: 'function' },
86
+ { blankLine: 'always', prev: 'multiline-const', next: '*' },
87
+ {
88
+ blankLine: 'always',
89
+ prev: 'import',
90
+ next: [
91
+ 'interface',
92
+ 'type',
93
+ 'block',
94
+ 'block-like',
95
+ 'case',
96
+ 'class',
97
+ 'const',
98
+ 'export',
99
+ 'expression',
100
+ 'for',
101
+ 'function',
102
+ 'if',
103
+ 'let',
104
+ 'return',
105
+ 'throw',
106
+ 'try',
107
+ 'while',
108
+ ],
109
+ },
110
+ {
111
+ blankLine: 'always',
112
+ prev: [
113
+ 'import',
114
+ 'interface',
115
+ 'type',
116
+ 'block',
117
+ 'block-like',
118
+ 'case',
119
+ 'class',
120
+ 'const',
121
+ 'expression',
122
+ 'for',
123
+ 'function',
124
+ 'if',
125
+ 'let',
126
+ 'return',
127
+ 'throw',
128
+ 'try',
129
+ 'while',
130
+ ],
131
+ next: 'export',
132
+ },
133
+ ],
30
134
  'jsx-a11y/anchor-is-valid': [
31
135
  'error',
32
136
  {
@@ -35,6 +139,33 @@ module.exports = {
35
139
  aspects: ['invalidHref', 'preferButton'],
36
140
  },
37
141
  ],
142
+ curly: ['error', 'multi-line'],
143
+ 'import/order': 0,
144
+ 'no-duplicate-imports': 2,
145
+ 'no-restricted-imports': [
146
+ 'error',
147
+ {
148
+ paths: ['ui'],
149
+ patterns: [
150
+ {
151
+ group: ['@sh/app', '@sh/app/*'],
152
+ message: 'Importing from `app` package is disallowed for architecture reasons',
153
+ },
154
+ ],
155
+ },
156
+ ],
157
+ 'import/no-restricted-paths': [
158
+ 'error',
159
+ {
160
+ zones: [
161
+ {
162
+ target: 'ui',
163
+ from: 'app',
164
+ message: 'Importing from `app` package is disallowed for architecture reasons',
165
+ },
166
+ ],
167
+ },
168
+ ],
38
169
  'react-hooks/exhaustive-deps': 2,
39
170
  'react-hooks/rules-of-hooks': 2,
40
171
  'react/button-has-type': 2,
@@ -46,10 +177,7 @@ module.exports = {
46
177
  'sort-imports': 0,
47
178
  'react/function-component-definition': [
48
179
  2,
49
- {
50
- namedComponents: 'arrow-function',
51
- unnamedComponents: 'arrow-function',
52
- },
180
+ { namedComponents: 'arrow-function', unnamedComponents: 'arrow-function' },
53
181
  ],
54
182
  'react/jsx-curly-brace-presence': [
55
183
  2,
@@ -60,13 +188,29 @@ module.exports = {
60
188
  ],
61
189
  'react/jsx-sort-props': [
62
190
  2,
191
+ { ignoreCase: true, callbacksLast: true, shorthandLast: false, reservedFirst: true },
192
+ ],
193
+ 'max-lines': [
194
+ 'error',
195
+ {
196
+ max: 300,
197
+ skipComments: true,
198
+ },
199
+ ],
200
+ 'simple-import-sort/imports': [
201
+ 1,
63
202
  {
64
- ignoreCase: true,
65
- callbacksLast: true,
66
- shorthandLast: false,
67
- reservedFirst: true,
203
+ groups: [
204
+ ['^\\u0000'],
205
+ ['^react', '^next', '^[^.]'],
206
+ ['^@shakuroinc/', '^@sh/'],
207
+ ['^libs$', '^libs/', '^features/'],
208
+ ['^\\.\\.(?!/?$)', '^\\.\\./?$', '^\\./(?=.*/)(?!/?$)', '^\\.(?!/?$)', '^\\./?$'],
209
+ ['^.+\\.s?css$'],
210
+ ],
68
211
  },
69
212
  ],
213
+ 'simple-import-sort/exports': 1,
70
214
  'tailwindcss/classnames-order': 2,
71
215
  'tailwindcss/no-contradicting-classname': 2,
72
216
  'tailwindcss/no-custom-classname': 1,
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @shakuroinc/eslint-config-react
2
2
 
3
- [Shakuro](https://shakuro.com/) eslint and prettier extensible basic config.
3
+ [Shakuro](https://shakuro.com/) eslint (with React and tailwindcss support) and prettier extensible basic config.
4
4
 
5
5
  ## Usage
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shakuroinc/eslint-config-react",
3
- "version": "6.0.2",
3
+ "version": "6.0.3",
4
4
  "main": ".eslintrc.js",
5
5
  "author": "Shakuro team",
6
6
  "license": "MIT",
@@ -14,7 +14,6 @@
14
14
  },
15
15
  "dependencies": {},
16
16
  "devDependencies": {
17
- "@shakuroinc/eslint-config-base": "^1.0.4",
18
17
  "@typescript-eslint/eslint-plugin": "^5.45.0",
19
18
  "@typescript-eslint/parser": "^5.45.0",
20
19
  "eslint": "^8.29.0",
@@ -35,7 +34,6 @@
35
34
  "typescript": "^4.9.3"
36
35
  },
37
36
  "peerDependencies": {
38
- "@shakuroinc/eslint-config-base": "^1.0.4",
39
37
  "@typescript-eslint/eslint-plugin": "^5.45.0",
40
38
  "@typescript-eslint/parser": "^5.45.0",
41
39
  "eslint": "^8.29.0",
@@ -1,7 +1,11 @@
1
1
  /* eslint-disable @typescript-eslint/no-var-requires */
2
- const baseConfig = require('@shakuroinc/eslint-config-base/prettier.config');
3
-
4
2
  module.exports = {
5
- ...baseConfig,
6
- plugins: [...(baseConfig.plugins ?? []), require('prettier-plugin-tailwindcss')],
3
+ arrowParens: 'avoid',
4
+ bracketSpacing: true,
5
+ plugins: [require('prettier-plugin-tailwindcss')],
6
+ printWidth: 100,
7
+ semi: true,
8
+ singleQuote: true,
9
+ tabWidth: 2,
10
+ trailingComma: 'all',
7
11
  };