Best way for multiple prefix rules
See original GitHub issueIs it possible to change prefixes for directory (without rewriting all rules)?
Styleguide says, that different modules can use different prefixes: toh-hero
, admin-users
.
https://angular.io/styleguide#!#02-07
Module versions tslint: 3.13.0 codelyzer: 0.0.28
Now, I can write all prefixes in tslint.json in root directory.
"directive-selector-prefix": [true, "app", "toh", "admin"]
"component-selector-prefix": [true, "app", "toh", "admin"]
If I create app/heroes/tslint.ts
, and write only rulesDirectory and prefixes rules, all other rules from ./tslint.ts
will not work in app/heroes/
directory.
Example
./tslint.ts
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
...
"directive-selector-prefix": [true, "app"],
"component-selector-prefix": [true, "app"],
...
}
}
app/heroes/tslint.ts
{
"rulesDirectory": [
"../../node_modules/codelyzer"
],
"rules": {
"directive-selector-prefix": [true, "toh"],
"component-selector-prefix": [true, "toh"],
}
}
app/heroes/hero.component.ts
@Component({
selector: 'toh-hero'
})
export class HeroComponent {}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:9 (5 by maintainers)
Top Results From Across the Web
How to Teach Prefixes (Mini Teaching Guide + Download)
Rule 1: Hyphenate the word when you add a prefix to a proper noun or a numeral. hyphenated prefix examples. Rule 2: Hyphenate...
Read more >Rootcast: A Multitude of "Multi-" Words - Membean
The English prefix multi- means “many.” Examples using this prefix include multivitamin and multiplication. An easy way to remember that the prefix multi-...
Read more >The Ultimate Guide to Using Prefixes
1: Keep the root. The spelling of the base word never changes. Simply add the prefix to the beginning of the base word....
Read more >Spelling Rules for Prefixes: Overview & Exceptions - Study.com
Identify and understand how to use prefixes. Examine the spelling rules and identify exceptions to the spelling rules. Study a list and ...
Read more >Organizing objects using prefixes - AWS Documentation
A prefix is a string of characters at the beginning of the object key name. A prefix can be any length, subject to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
the tslint extends feature works for this: I simply add a tslint.json file in the relevant folder like this
The following format makes sense to be used:
The keys are the directory names, relative to the project root, and the values are list of prefixes.
@ValeryVS any opinion?