-
Notifications
You must be signed in to change notification settings - Fork 3
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: Rewrite the ESLint config file for this repo with Flat Config #355
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.
fixed with unicorn/prefer-export-from
rule.
@@ -28,7 +28,7 @@ module.exports = { | |||
'import/core-modules': [], | |||
'import/ignore': [ | |||
'node_modules', | |||
'\\.(coffee|scss|css|less|hbs|svg|json|jpg|jpeg|png|webp)$', | |||
String.raw`\.(coffee|scss|css|less|hbs|svg|json|jpg|jpeg|png|webp)$`, |
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.
fixed with unicorn/prefer-string-raw
@@ -39,12 +39,11 @@ module.exports = { | |||
name: 'isNaN', | |||
message: 'Use Number.isNaN instead.', | |||
}, | |||
].concat( | |||
confusingBrowserGlobals.map((g) => ({ | |||
...confusingBrowserGlobals.map((g) => ({ |
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.
fixed with unicorn/prefer-spread
rule.
const { readdirSync } = require('node:fs'); | ||
const path = require('node:path'); |
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.
fixed with unicorn/prefer-node-protocol
rule.
}) | ||
.map((dirnet) => extractFilePath(dirnet, dir)) | ||
.flat(); | ||
}).flatMap((dirnet) => extractFilePath(dirnet, directory)); |
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.
fixed with unicorn/prefer-array-flat-map
rule.
|
||
test('parsable all eslintrc format configs', () => { | ||
const dir = resolve(join(__dirname, '../configs/eslintrc')); | ||
const directory = path.resolve(path.join(__dirname, '../configs/eslintrc')); |
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.
fixed with unicorn/prevent-abbreviations
rule.
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.
This file was installed for snapshot testing, but it was found to be unnecessary so I deleted it.
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 🙆♂️ Thank you!
🎉 This PR is included in version 5.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What changed / motivation ?
When ESLint is updated to v9 in #354,
eslintrc
will be deprecated, and it will become difficult to use.eslintrc.js
for this repository. Therefore, I rewrote.eslintrc.js
aseslint.config.mjs
in advance.In addition, as a result of this, invalid code that was not detected before is now properly detected, so I fixed them at this time.
Linked PR / Issues
Type of change
Pre-flight checklist
References