@d-zero/eslint-config 5.0.0-alpha.10 → 5.0.0-alpha.12

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.
Files changed (3) hide show
  1. package/base.js +126 -13
  2. package/index.js +10 -39
  3. package/package.json +7 -10
package/base.js CHANGED
@@ -62,22 +62,137 @@ module.exports = {
62
62
  },
63
63
  ],
64
64
 
65
- // sort-class-members
65
+ // Sort Class members
66
66
  'sort-class-members/sort-class-members': [
67
67
  1,
68
68
  {
69
69
  order: [
70
+ '[public-properties]',
71
+ '[public-readonly-properties]',
72
+ '[public-properties-function]',
73
+ '[private-properties]',
74
+ '[private-properties-function]',
75
+ '[accessor-pairs]',
76
+ 'constructor',
77
+ '[public-methods]',
78
+ '[private-methods]',
79
+ '[protedted-methods]',
70
80
  '[static-properties]',
71
81
  '[static-methods]',
72
- '[properties]',
73
- '[conventional-private-properties]',
74
- 'constructor',
75
- '[methods]',
76
- '[conventional-private-methods]',
82
+ '[everything-else]',
77
83
  ],
84
+ groups: {
85
+ 'public-properties': [
86
+ {
87
+ type: 'property',
88
+ kind: 'nonAccessor',
89
+ static: false,
90
+ private: false,
91
+ override: false,
92
+ readonly: false,
93
+ sort: 'alphabetical',
94
+ },
95
+ ],
96
+ 'public-readonly-properties': [
97
+ {
98
+ type: 'property',
99
+ kind: 'nonAccessor',
100
+ static: false,
101
+ private: false,
102
+ override: false,
103
+ readonly: true,
104
+ sort: 'alphabetical',
105
+ },
106
+ ],
107
+ 'public-properties-function': [
108
+ {
109
+ type: 'property',
110
+ propertyType: 'ArrowFunctionExpression',
111
+ kind: 'nonAccessor',
112
+ static: false,
113
+ private: false,
114
+ accessibility: 'public',
115
+ override: false,
116
+ sort: 'alphabetical',
117
+ },
118
+ ],
119
+ 'private-properties': [
120
+ {
121
+ type: 'property',
122
+ kind: 'nonAccessor',
123
+ static: false,
124
+ private: true,
125
+ override: false,
126
+ sort: 'alphabetical',
127
+ },
128
+ ],
129
+ 'private-properties-function': [
130
+ {
131
+ type: 'property',
132
+ propertyType: 'ArrowFunctionExpression',
133
+ kind: 'nonAccessor',
134
+ static: false,
135
+ private: true,
136
+ accessibility: 'public',
137
+ override: false,
138
+ sort: 'alphabetical',
139
+ },
140
+ ],
141
+ 'public-methods': [
142
+ {
143
+ type: 'method',
144
+ kind: 'nonAccessor',
145
+ static: false,
146
+ private: false,
147
+ override: false,
148
+ sort: 'alphabetical',
149
+ },
150
+ ],
151
+ 'private-methods': [
152
+ {
153
+ name: '/#.+/',
154
+ type: 'method',
155
+ kind: 'nonAccessor',
156
+ static: false,
157
+ private: true,
158
+ override: false,
159
+ sort: 'alphabetical',
160
+ },
161
+ ],
162
+ 'protedted-methods': [
163
+ {
164
+ name: '/_.+/',
165
+ type: 'method',
166
+ static: false,
167
+ sort: 'alphabetical',
168
+ },
169
+ ],
170
+ },
78
171
  accessorPairPositioning: 'getThenSet',
79
172
  },
80
173
  ],
174
+
175
+ 'no-restricted-syntax': [
176
+ 2,
177
+ {
178
+ selector:
179
+ ':matches(PropertyDefinition, MethodDefinition)[accessibility="private"]',
180
+ message: 'Use #private instead',
181
+ },
182
+ {
183
+ selector:
184
+ ':matches(PropertyDefinition, MethodDefinition)[accessibility="public"]',
185
+ message: 'Remove public keyword',
186
+ },
187
+ {
188
+ selector: 'MethodDefinition[key.name=/^_/]:not([accessibility="protected"])',
189
+ message: 'Add protected keyword',
190
+ },
191
+ {
192
+ selector: 'MethodDefinition:not([key.name=/^_/])[accessibility="protected"]',
193
+ message: 'Start with `_` if you want to use protected',
194
+ },
195
+ ],
81
196
  },
82
197
  settings: {
83
198
  jsdoc: {
@@ -89,13 +204,11 @@ module.exports = {
89
204
  },
90
205
  overrides: [
91
206
  {
92
- files: '**/*.spec.*',
93
- rules: {
94
- 'import/no-extraneous-dependencies': 0,
95
- },
96
- },
97
- {
98
- files: ['*.config.{js,mjs,json,ts}', '.*rc.{js,mjs,json,ts}'],
207
+ files: [
208
+ '*.{test,spec}.{js,mjs,json}',
209
+ '*.config.{js,mjs,json}',
210
+ '.*rc.{js,mjs,json}',
211
+ ],
99
212
  rules: {
100
213
  'import/no-extraneous-dependencies': 0,
101
214
  },
package/index.js CHANGED
@@ -6,8 +6,9 @@ const base = require('./base');
6
6
  module.exports = {
7
7
  ...base,
8
8
  overrides: [
9
+ ...base.overrides,
9
10
  {
10
- files: '**/*.{ts,tsx}',
11
+ files: ['*.{ts,tsx}', '**/*.{ts,tsx}'],
11
12
  extends: ['plugin:import/typescript', 'plugin:@typescript-eslint/recommended'],
12
13
  plugins: ['@typescript-eslint', ...base.plugins],
13
14
  parser: '@typescript-eslint/parser',
@@ -32,47 +33,17 @@ module.exports = {
32
33
  '@typescript-eslint/no-var-requires': 2,
33
34
  '@typescript-eslint/no-unnecessary-type-assertion': 2,
34
35
  '@typescript-eslint/restrict-plus-operands': 0,
36
+ '@typescript-eslint/no-explicit-any': [1, { fixToUnknown: true }],
35
37
  '@typescript-eslint/consistent-type-imports': 1,
36
38
  '@typescript-eslint/require-await': 2,
37
39
  '@typescript-eslint/no-floating-promises': 2,
38
- '@typescript-eslint/member-ordering': [
39
- 'warn',
40
- {
41
- default: 'never',
42
- classes: {
43
- memberTypes: [
44
- 'public-static-field',
45
- 'protected-static-field',
46
- 'private-static-field',
47
- 'public-static-method',
48
- 'protected-static-method',
49
- 'public-static-get',
50
- 'protected-static-get',
51
- 'private-static-get',
52
- 'public-instance-field',
53
- 'protected-instance-field',
54
- 'private-instance-field',
55
- 'public-abstract-field',
56
- 'protected-abstract-field',
57
- 'public-constructor',
58
- 'protected-constructor',
59
- 'private-constructor',
60
- ['public-abstract-get', 'public-abstract-set'],
61
- ['protected-abstract-get', 'protected-abstract-set'],
62
- ['public-instance-get', 'public-instance-set'],
63
- ['protected-instance-get', 'protected-instance-set'],
64
- ['private-instance-get', 'private-instance-set'],
65
- 'public-abstract-method',
66
- 'protected-abstract-method',
67
- 'public-instance-method',
68
- 'protected-instance-method',
69
- 'private-instance-method',
70
- 'private-static-method',
71
- ],
72
- order: 'alphabetically',
73
- },
74
- },
75
- ],
40
+ '@typescript-eslint/member-ordering': 0,
41
+ },
42
+ },
43
+ {
44
+ files: ['*.{test,spec}.{ts,mts,tsx}'],
45
+ rules: {
46
+ 'import/no-extraneous-dependencies': 0,
76
47
  },
77
48
  },
78
49
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d-zero/eslint-config",
3
- "version": "5.0.0-alpha.10",
3
+ "version": "5.0.0-alpha.12",
4
4
  "description": "Configurations of ESLint",
5
5
  "repository": "https://github.com/d-zero-dev/linters.git",
6
6
  "author": "D-ZERO Co., Ltd.",
@@ -24,18 +24,15 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@typescript-eslint/eslint-plugin": "7.0.1",
28
- "@typescript-eslint/parser": "7.0.1",
29
- "eslint": "8.56.0",
27
+ "@typescript-eslint/eslint-plugin": "7.1.0",
28
+ "@typescript-eslint/parser": "7.1.0",
29
+ "eslint": "8.57.0",
30
30
  "eslint-plugin-eslint-comments": "3.2.0",
31
31
  "eslint-plugin-import": "2.29.1",
32
- "eslint-plugin-jsdoc": "48.1.0",
32
+ "eslint-plugin-jsdoc": "48.2.0",
33
33
  "eslint-plugin-regexp": "2.2.0",
34
- "eslint-plugin-sort-class-members": "1.19.0",
34
+ "eslint-plugin-sort-class-members": "1.20.0",
35
35
  "eslint-plugin-unicorn": "51.0.1"
36
36
  },
37
- "peerDependencies": {
38
- "@d-zero/tsconfig": ">= 5"
39
- },
40
- "gitHead": "42655b5087864dcb26cec6c694ee3bd0bb1fe97d"
37
+ "gitHead": "61145d5dfd13cff6630f882c5e11e3c5e3fb8d39"
41
38
  }