-
-
Notifications
You must be signed in to change notification settings - Fork 681
Update: deprecate no-invalid-*
rules and add valid-*
rules (fixes #103)
#132
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
Conversation
For reference, new rules are added by the script below: const fs = require('fs')
const path = require('path')
for (const root of ['docs/rules', 'lib/rules', 'tests/lib/rules']) {
for (const filename of fs.readdirSync(root)) {
if (!filename.startsWith('no-invalid-')) {
continue
}
const src = path.join(root, filename)
const dst = path.join(root, 'valid-' + filename.slice('no-invalid-'.length))
const content = fs.readFileSync(src, 'utf8')
.replace(/no-invalid-/g, 'valid-')
.replace(/disallow invalid/g, 'enforce valid')
.replace(/Disallow invalid/g, 'Enforce valid')
fs.writeFileSync(dst, content)
}
} |
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.
LGTM 👍 two minor copy suggestions
tools/update-rules.js
Outdated
### Deprecated | ||
|
||
> - :warning: We are going to remove deprecated rules in future. Please migrate to its replaced rules. | ||
> - :innocent: We don't fix bugs which are in deprecated rules since we don't have enough resource. |
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.
resources
tools/update-rules.js
Outdated
`).join('\n') + ` | ||
### Deprecated | ||
|
||
> - :warning: We are going to remove deprecated rules in future. Please migrate to its replaced rules. |
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 remove deprecated rules in the next major release. Please migrate to successor/new rules.
Thank you for review! I updated this PR. |
Fixes #103.
This PR renames
no-invalid-*
rules to avoid double negation.New naming is
valid-*
similar to some core rules;valid-jsdoc
andvalid-typeof
.This PR deprecates
no-invalid-*
rules and doesn't remove those. So this is not a breaking change. We can remove those in future.Additionally, this PR creates the table of deprecated rules and removes deprecated rules from rule tables.