Skip to content
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

Enable id-denylist and id-length in base config #200

Merged
merged 6 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"setup": "yarn install && yarn allow-scripts",
"lint:eslint": "yarn eslint . --ext ts,js",
"lint:config-validation": "node ./scripts/validate-configs.js",
"lint:misc": "prettier '**/*.json' '**/*.md' '!**/CHANGELOG.md' '**/*.yml' --ignore-path .gitignore",
"lint:misc": "prettier '**/*.json' '!**/rules-snapshot.json' '**/*.md' '!**/CHANGELOG.md' '**/*.yml' --ignore-path .gitignore",
rekmarks marked this conversation as resolved.
Show resolved Hide resolved
"lint": "yarn lint:eslint && yarn lint:misc --check && yarn lint:config-validation",
"lint:fix": "yarn lint:eslint --fix && yarn lint:misc --write && yarn lint:config-validation --write"
},
Expand Down
22 changes: 22 additions & 0 deletions packages/base/rules-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,28 @@
"getter-return": "error",
"grouped-accessor-pairs": "error",
"guard-for-in": "error",
"id-denylist": [
"error",
"buf",
"cat",
"err",
"cb",
"cfg",
"hex",
"int",
"msg",
"num",
"opt",
"sig"
],
"id-length": [
"error",
{
"min": 2,
"properties": "never",
"exceptionPatterns": ["_", "a", "b", "i", "j", "k"]
}
],
"implicit-arrow-linebreak": "off",
"import/default": "error",
"import/export": "error",
Expand Down
24 changes: 24 additions & 0 deletions packages/base/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,30 @@ module.exports = {
'func-name-matching': 'error',
'grouped-accessor-pairs': 'error',
'guard-for-in': 'error',
'id-denylist': [
// This sets this rule to 'error', the rest are the forbidden IDs.
'error',
// These are basically all useless contractions.
'buf',
'cat',
'err',
'cb',
'cfg',
'hex',
'int',
'msg',
'num',
'opt',
'sig',
],
'id-length': [
'error',
{
min: 2,
properties: 'never',
exceptionPatterns: ['_', 'a', 'b', 'i', 'j', 'k'],
},
],
'lines-between-class-members': 'error',
'max-statements-per-line': [
'error',
Expand Down