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
{{ message }}
Repository navigation
Commit c8a6d80
Browse filesBrowse the repository at this point in the historyBrowse files
feat(eslint-plugin): [naming-convention] add support for #private modifier on class members (#6259)
* Add `#private` as a modifier
Numbers for TypeModifiers are changed as instructed by the comment in the Modifiers enum
* Add support for `#private` modifier
* Add tests
* Add docs
Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com>
Copy file name to clipboardExpand all lines: packages/eslint-plugin/docs/rules/naming-convention.md
+7-6Lines changed: 7 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,7 +159,7 @@ If these are provided, the identifier must start with one of the provided values
159
159
- Accepts one or array of selectors to define an option block that applies to one or multiple selectors.
160
160
- For example, if you provide `{ selector: ['function', 'variable'] }`, then it will apply the same option to variable and function nodes.
161
161
- See [Allowed Selectors, Modifiers and Types](#allowed-selectors-modifiers-and-types) below for the complete list of allowed selectors.
162
-
-`modifiers` allows you to specify which modifiers to granularly apply to, such as the accessibility (`private`/`protected`/`public`), or if the thing is `static`, etc.
162
+
-`modifiers` allows you to specify which modifiers to granularly apply to, such as the accessibility (`#private`/`private`/`protected`/`public`), or if the thing is `static`, etc.
163
163
- The name must match _all_ of the modifiers.
164
164
- For example, if you provide `{ modifiers: ['private','readonly','static'] }`, then it will only match something that is `private static readonly`, and something that is just `private` will not match.
165
165
- The following `modifiers` are allowed:
@@ -172,6 +172,7 @@ If these are provided, the identifier must start with one of the provided values
172
172
-`requiresQuotes` - matches any name that requires quotes as it is not a valid identifier (i.e. has a space, a dash, etc in it).
173
173
-`public` - matches any member that is either explicitly declared as `public`, or has no visibility modifier (i.e. implicitly public).
174
174
-`abstract`,`override`,`private`,`protected`,`readonly`,`static` - matches any member explicitly declared with the given modifier.
175
+
-`#private` - matches any member with a private identifier (an identifier that starts with `#`)
175
176
-`async` - matches any method, function, or function variable which is async via the `async` keyword (e.g. does not match functions that return promises without using `async` keyword)
176
177
-`types` allows you to specify which types to match. This option supports simple, primitive types only (`array`,`boolean`,`function`,`number`,`string`).
177
178
- The name must match _one_ of the types.
@@ -204,7 +205,7 @@ Individual Selectors match specific, well-defined sets. There is no overlap betw
-`objectLiteralProperty` - matches any object literal property. Does not match properties that have direct function expression or arrow function expression values.
-`classMethod` - matches any class method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors.
-`objectLiteralMethod` - matches any object literal method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors.
0 commit comments