eslint-config-gristow 2.0.11 → 2.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-gristow",
3
- "version": "2.0.11",
3
+ "version": "2.0.12",
4
4
  "description": "Eslint settings for Greg Ristow",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -14,6 +14,7 @@
14
14
  "@typescript-eslint/parser": "^5.59.5",
15
15
  "eslint": "^8.40.0",
16
16
  "eslint-config-airbnb": "^19.0.4",
17
+ "eslint-config-airbnb-base": "^15.0.0",
17
18
  "eslint-config-airbnb-typescript": "^17.0.0",
18
19
  "eslint-config-prettier": "^8.5.0",
19
20
  "eslint-import-resolver-typescript": "^3.5.5",
@@ -0,0 +1,67 @@
1
+ module.exports = {
2
+ '@typescript-eslint/naming-convention': [
3
+ 'error',
4
+ // By default, all should be camelCase
5
+ {
6
+ selector: 'default',
7
+ format: ['camelCase'],
8
+ },
9
+ // Or, in the case of class names, type names, and interfaces, UpperCamelCase
10
+ // Make sure types and interfaces are in PascalCase. (Also applies
11
+ // to classes.)
12
+ {
13
+ selector: 'typeLike',
14
+ format: ['PascalCase'],
15
+ },
16
+ // But, when we're destructuring, allow whatever it was:
17
+ {
18
+ selector: 'variable',
19
+ modifiers: ['destructured'],
20
+ format: null,
21
+ },
22
+ // And, if the property requires quotes, allow anything:
23
+ {
24
+ selector: [
25
+ 'classProperty',
26
+ 'objectLiteralProperty',
27
+ 'typeProperty',
28
+ 'classMethod',
29
+ 'objectLiteralMethod',
30
+ 'typeMethod',
31
+ 'accessor',
32
+ 'enumMember',
33
+ ],
34
+ format: null,
35
+ modifiers: ['requiresQuotes'],
36
+ },
37
+ // But require variables to be in camelCase or UPPER_SNAKE
38
+ {
39
+ selector: 'variable',
40
+ format: ['camelCase', 'UPPER_CASE'],
41
+ },
42
+ // Allow leading underscores in function params
43
+ {
44
+ selector: 'parameter',
45
+ format: ['camelCase'],
46
+ leadingUnderscore: 'allow',
47
+ },
48
+ // Allow leading underscores in class private members
49
+ {
50
+ selector: 'memberLike',
51
+ modifiers: ['private'],
52
+ format: ['camelCase'],
53
+ leadingUnderscore: 'allow',
54
+ },
55
+ // And allow snake_case in object literals -- which simplifies
56
+ // our interaction with external libraries where options objects
57
+ // often require these.
58
+ {
59
+ selector: 'objectLiteralProperty',
60
+ filter: {
61
+ regex: '^[a-zA-Z]+(_[a-zA-Z\\d]+)*$',
62
+ match: true,
63
+ },
64
+ format: null,
65
+ },
66
+ ],
67
+ };
@@ -1,3 +1,5 @@
1
+ const namingConvention = require('./naming-convention.cjs');
2
+
1
3
  /**
2
4
  * These rules are shared by both .js and .ts
3
5
  */
@@ -94,68 +96,5 @@ module.exports = {
94
96
  // ignoreImports: true,
95
97
  // }],
96
98
  camelcase: 'off',
97
- '@typescript-eslint/naming-convention': [
98
- 'error',
99
- // By default, all should be camelCase
100
- {
101
- selector: 'default',
102
- format: ['camelCase'],
103
- },
104
- // But, when we're destructuring, allow whatever it was:
105
- {
106
- selector: 'variable',
107
- modifiers: ['destructured'],
108
- format: null,
109
- },
110
- // And, if the property requires quotes, allow anything:
111
- {
112
- selector: [
113
- 'classProperty',
114
- 'objectLiteralProperty',
115
- 'typeProperty',
116
- 'classMethod',
117
- 'objectLiteralMethod',
118
- 'typeMethod',
119
- 'accessor',
120
- 'enumMember',
121
- ],
122
- format: null,
123
- modifiers: ['requiresQuotes'],
124
- },
125
- // But require variables to be in camelCase or UPPER_SNAKE
126
- {
127
- selector: 'variable',
128
- format: ['camelCase', 'UPPER_CASE'],
129
- },
130
- // Allow leading underscores in function params
131
- {
132
- selector: 'parameter',
133
- format: ['camelCase'],
134
- leadingUnderscore: 'allow',
135
- },
136
- // Allow leading underscores in class private members
137
- {
138
- selector: 'memberLike',
139
- modifiers: ['private'],
140
- format: ['camelCase'],
141
- leadingUnderscore: 'allow',
142
- },
143
- // And allow snake_case in object literals -- which simplifies
144
- // our interaction with external libraries where options objects
145
- // often require these.
146
- {
147
- selector: 'objectLiteralProperty',
148
- filter: {
149
- regex: '^[a-zA-Z]+(_[a-zA-Z\\d]+)*$',
150
- match: true,
151
- },
152
- format: null,
153
- },
154
- // Make sure types and interfaces are in PascalCase. (Also applies
155
- // to classes.)
156
- {
157
- selector: 'typeLike',
158
- format: ['PascalCase'],
159
- },
160
- ],
99
+ ...namingConvention,
161
100
  };