@d-zero/eslint-config 5.0.0-alpha.11 → 5.0.0-alpha.13

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