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

build: configure ESLint for JSDoc types #249

Merged
merged 1 commit into from
Apr 7, 2023

Conversation

johnhooks
Copy link
Collaborator

What?

ESLint configuration requires some tweaks to work well with JSDoc types.

Why?

Without this changes there are linting errors when importing JSDoc types from other files.

How?

Add the TypeScript import resolver and configure properly.

Details of why jsconfig.eslint.json is also necessary can be found here https://typescript-eslint.io/linting/troubleshooting/#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file

@johnhooks johnhooks requested a review from erikyo April 7, 2023 18:33

return {
presets: ['@wordpress/babel-preset-default'],
presets: [ '@wordpress/babel-preset-default' ],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most the configs didn't follow the linting rules.

Comment on lines +6 to +12
"include": [
".eslintrc.js",
".prettierrc.js",
"babel.config.js",
"jest.config.js",
"webpack.config.js"
]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnhooks
Copy link
Collaborator Author

Another benefit to this is it lints the config files in the top level now.

@johnhooks johnhooks changed the title build: configure eslint for JSDoc types build: configure ESLint for JSDoc types Apr 7, 2023
Copy link
Collaborator

@erikyo erikyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@johnhooks johnhooks merged commit 1c2f00e into WordPress:develop Apr 7, 2023
@johnhooks johnhooks deleted the build/config-eslint-for-ts branch April 12, 2023 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants