-
Notifications
You must be signed in to change notification settings - Fork 887
Conversation
src/configs/all.ts
Outdated
"no-shadowed-variable": true, | ||
"no-string-literal": true, | ||
"no-string-throw": true, | ||
// "no-switch-case-fall-through": Won't this be deprecated? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, just delete this line
src/configs/all.ts
Outdated
"no-unsafe-any": true, | ||
"no-unsafe-finally": true, | ||
"no-unused-expression": true, | ||
// "no-unused-variable": Won't this be deprecated? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still keeping it around; you probably ought to enable it here actually, given the kind of semantics you're going for for tslint:all
src/configs/all.ts
Outdated
"strict-type-predicates": true, | ||
// "switch-default": Won't this be deprecated? | ||
"triple-equals": true, | ||
// "typeof-compare": Won't this be deprecated? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, remove
src/configs/all.ts
Outdated
"restrict-plus-operands": true, | ||
"strict-boolean-expressions": true, | ||
"strict-type-predicates": true, | ||
// "switch-default": Won't this be deprecated? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're going to keep it around actually, let's enable it here
2fd4917
to
71b3107
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost there, small change requested
test/ruleLoaderTests.ts
Outdated
const expectedAllRules = everyRule().filter((ruleName) => { | ||
// Some rules intentionally excluded | ||
switch (ruleName) { | ||
case "ban": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should maintain this blacklist in configs/all.ts
as an array, and do RULES_EXCLUDED_FROM_ALL_CONFIG.indexOf(ruleName) === -1
in this filter
test/ruleLoaderTests.ts
Outdated
|
||
function everyRule(): string[] { | ||
return fs.readdirSync(srcRulesDir) | ||
.filter((file) => /Rule.ts$/.test(file)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: expected 8 spaces of indentation
Is there a command to list all rules used in tslint.json including specified via "extends" property? |
@tonghae that's possible, but not with TSLint itself. I wrote a linter that allows to execute TSLint rules. It also knows how to handle the configuration correctly. yarn add @fimbul/wotan @fimbul/valtyr
# or
npm install @fimbul/wotan @fimbul/valtyr Note that you might need to use # lookup the tslint.json for 'path/to/file.ts' like TSLint does
wotan show -m @fimbul/valtyr path/to/file.ts
# use a specific config file, not necessarily the one that TSLint's lookup finds
wotan show -m @fimbul/valtyr path/to/file.ts -c path/to/config.json
# you can even use config presets like 'tslint:all'
wotan show -m @fimbul/valtyr path/to/file.ts -c tslint:all
# output as JSON instead of YAML
wotan show -m @fimbul/valtyr path/to/file.ts -f json |
PR checklist
Overview of change:
Minimal-change version of #2241
CHANGELOG.md entry:
[api]
tslint:all
configuration