-
Notifications
You must be signed in to change notification settings - Fork 8
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
refactor: Update ESLint rulesets #61
base: develop
Are you sure you want to change the base?
refactor: Update ESLint rulesets #61
Conversation
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 a lot of changes here, with no justification of what/why.
Might make sense to move these into multiple (atomic) PRs, or to put them in our internal config for now until we can have a real discussion about what rules make it into a public ruleset and why.
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.
Have migrated rulesets to internal config in d5767a3.
Please let me know if I should migrate the added plugins & extended rulesets also to the internal config.
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.
Unless you want to spend the extra justifying them (and the other preexisting ones that are included in @wordpress/eslint-plugin/recommended
) ;-)
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.
:-/ Same problem as the previous (now closed PRs): i.e. this is changes a lot of configs, but there's
- no justification (inline or in the PR description) for the changes
- too much strictness going into an ecosystem package (vs our internal code that we could theoretically change up).
Please do let me know if I should go ahead and update the PR description explaining each ruleset along with the reason why we added it. |
…actor/eslint-configs
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.
'jsdoc/require-jsdoc': [ | ||
'error', | ||
{ | ||
require: { | ||
ArrowFunctionExpression: true, | ||
ClassDeclaration: true, | ||
ClassExpression: true, | ||
FunctionExpression: true, | ||
MethodDefinition: true, | ||
}, | ||
}, | ||
], |
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.
Call it a hunch, but I'm betting all the JSDoc type changes should be stripped out into their own PR
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.
Not sure (Just doc rules) but we can do that also.
Please let me know and will create a separate PR.
|
We will be breaking down this PR into smaller PRs so that it is easier to fix eslint error we get after adding the ruleset. --- Edit ---
|
@Pathan-Amaankhan is there anything left from this PR worth backporting or can we close? |
Note
This pull request (PR) constitutes Part 2 of the migration process for the subsequent PRs:
What
ESLint Changes
.eslintrc.cjs
Fileparser
@typescript-eslint/parser
parser migrated frompackages/eslint-config/index.js
as it is not required in public package because JavaScript files are shipped. (ref: refactor: Update eslint import-resolver for TS #60 (comment))ignorePatterns
rules
@typescript-eslint/naming-convention
@typescript-eslint/no-restricted-imports
classnames
&lodash
imports in TypeScript files.dot-notation
allowKeywords
option to false prevents using reserved keywords.eslint-comments/require-description
import/default
import/named
jest/expect-expect
jsdoc/no-types
@param
&@return
jsdoc/require-param-type
@param
tag has a type value (within curly brackets).jsdoc/require-returns-type
@returns
tag has a type value (in curly brackets).@stylistic/jsx/jsx-closing-tag-location
no-empty-function
no-restricted-imports
classnames
&lodash
imports in JavaScript files.no-restricted-syntax
prefer-destructuring
react/jsx-boolean-value
react/jsx-curly-brace-presence
overrides
packages/eslint-config/index.js
Fileplugins
The following new plugins have been added:
extends
plugin:eslint-comments/recommended
Related Issue(s):
Testing Instructions
npm install
&&npm run lint
.Additional Info
Checklist