You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(eslint-plugin): [naming-convention] add modifiers exported, global, and destructured (typescript-eslint#2808)
Fixestypescript-eslint#2239Fixestypescript-eslint#2512Fixestypescript-eslint#2318Closestypescript-eslint#2802
Adds the following modifiers:
- `exported` - matches anything that is exported from the module.
- `global` - matches a variable/function declared in the top-level scope.
- `destructured` - matches a variable declared via an object destructuring pattern (`const {x, z = 2}`).
Copy file name to clipboardExpand all lines: packages/eslint-plugin/docs/rules/naming-convention.md
+29-6Lines changed: 29 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -163,6 +163,10 @@ If these are provided, the identifier must start with one of the provided values
163
163
- For example, if you provide `{ modifiers: ['private', 'static', 'readonly'] }`, then it will only match something that is `private static readonly`, and something that is just `private` will not match.
164
164
- The following `modifiers` are allowed:
165
165
-`const` - matches a variable declared as being `const` (`const x = 1`).
166
+
-`destructured` - matches a variable declared via an object destructuring pattern (`const {x, z = 2}`).
167
+
- Note that this does not match renamed destructured properties (`const {x: y, a: b = 2}`).
168
+
-`global` - matches a variable/function declared in the top-level scope.
169
+
-`exported` - matches anything that is exported from the module.
166
170
-`public` - matches any member that is either explicitly declared as `public`, or has no visibility modifier (i.e. implicitly public).
167
171
-`readonly`, `static`, `abstract`, `protected`, `private` - matches any member explicitly declared with the given modifier.
168
172
-`types` allows you to specify which types to match. This option supports simple, primitive types only (`boolean`, `string`, `number`, `array`, `function`).
@@ -200,10 +204,10 @@ There are two types of selectors, individual selectors, and grouped selectors.
200
204
Individual Selectors match specific, well-defined sets. There is no overlap between each of the individual selectors.
0 commit comments