-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[naming-convention] modifier export - Allow selecting only exported members #2239
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
how come you want to specifically name exported variables differently to non-exported variables? |
When importing constants, I tend to like them being in upper case so that I can tell they are a constant at a glance and not something else like a function. When just using constants in a module (without exporting them), there's no need to make upper case as it is clear from context what they are. |
I came to suggest the same thing but because I do things the other way around. I tend to use constants within a module for magic numbers and such but for exported objects prefer camel case. |
Looks to me that it is the reasons for public/private class members applies really well for exported and non exported identifiers within a module |
I'd also add this modifier for |
…lobal`, and `destructured` modifiers - add selectors `classProperty`, `objectLiteralProperty`, `typeProperty`, `classMethod`, `objectLiteralMethod`, `typeMethod` Fixes #2239 Fixes #2512 Fixes #2318 Fixes #1477 Big update to add a bunch of stuff. I couldn't be bothered splitting this out into separate PRs.
…lobal`, and `destructured` modifiers - add selectors `classProperty`, `objectLiteralProperty`, `typeProperty`, `classMethod`, `objectLiteralMethod`, `typeMethod` Fixes #2239 Fixes #2512 Fixes #2318 Fixes #1477 Big update to add a bunch of stuff. I couldn't be bothered splitting this out into separate PRs. 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, ignored: y, z = 2}`). Adds the following selectors (self explanatory - just breaking the selectors up): - `classProperty` - `objectLiteralProperty` - `typeProperty` - `classMethod` - `objectLiteralMethod` - `typeMethod` Converts - `property` to a meta selector for `classProperty`, `objectLiteralProperty`, `typeProperty` - `method` to a meta selector for `classMethod`, `objectLiteralMethod`, `typeMethod`
…lobal`, and `destructured` modifiers - add selectors `classProperty`, `objectLiteralProperty`, `typeProperty`, `classMethod`, `objectLiteralMethod`, `typeMethod` Fixes #2239 Fixes #2512 Fixes #2318 Fixes #1477 Big update to add a bunch of stuff. I couldn't be bothered splitting this out into separate PRs. 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, ignored: y, z = 2}`). Adds the following selectors (self explanatory - just breaking the selectors up): - `classProperty` - `objectLiteralProperty` - `typeProperty` - `classMethod` - `objectLiteralMethod` - `typeMethod` Converts - `property` to a meta selector for `classProperty`, `objectLiteralProperty`, `typeProperty` - `method` to a meta selector for `classMethod`, `objectLiteralMethod`, `typeMethod`
…lobal`, and `destructured` Fixes #2239 Fixes #2512 Fixes #2318 Closes #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, ignored: y, z = 2}`).
…lobal`, and `destructured` Fixes #2239 Fixes #2512 Fixes #2318 Closes #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}`).
…lobal`, and `destructured` Fixes #2239 Fixes #2512 Fixes #2318 Closes #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}`).
…lobal`, and `destructured` (#2808) Fixes #2239 Fixes #2512 Fixes #2318 Closes #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}`).
Repro
Expected Result
The ability to enforce a naming convention that only applies to exported members.
Actual Result
Cannot narrow down selector enough.
Additional Info
Related to: #1612
Versions
@typescript-eslint/eslint-plugin
3.4.0
@typescript-eslint/parser
3.4.0
TypeScript
3.9.5
ESLint
7.2.0
node
14.4.0
npm
6.14.5
The text was updated successfully, but these errors were encountered: