-
-
Notifications
You must be signed in to change notification settings - Fork 32
feat!: remove eslint v8 / eslintrc support and remove flat/
prefix from configs
#528
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
Changes from all commits
8e99f55
58979a8
ad7c699
72b9844
61fc644
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,29 +96,54 @@ module.exports = { | |
} | ||
``` | ||
|
||
```js | ||
// eslint.config.js | ||
import eslintPlugin from 'eslint-plugin-eslint-plugin'; | ||
|
||
export default [ | ||
{ | ||
plugins: { 'eslint-plugin': eslintPlugin }, | ||
rules: { | ||
'eslint-plugin/require-meta-docs-url': [ | ||
'error', | ||
{ | ||
pattern: | ||
'https://github.com/eslint-community/eslint-plugin-eslint-plugin/blob/master/docs/rules/{{name}}.md', | ||
}, | ||
], | ||
}, | ||
}, | ||
]; | ||
``` | ||
|
||
If you set the `pattern` option, this rule adds `meta.docs.url` property automatically when you execute `eslint --fix` command. | ||
|
||
## Version specific URL | ||
|
||
If you want to enforce version-specific URLs, it's feasible easily with `.eslintrc.js` and `npm version <type>` script. | ||
If you want to enforce version-specific URLs, it's feasible easily with `eslint.config.js` and `npm version <type>` script. | ||
For example: | ||
|
||
**.eslintrc.js**: | ||
**eslint.config.js**: | ||
|
||
```js | ||
// const version = require("./package.json").version; | ||
|
||
module.exports = { | ||
plugins: ['eslint-plugin'], | ||
rules: { | ||
'eslint-plugin/require-meta-docs-url': [ | ||
'error', | ||
{ | ||
pattern: `path/to/v${version}/docs/rules/{{name}}.md`, | ||
}, | ||
], | ||
import eslintPlugin from 'eslint-plugin-eslint-plugin'; | ||
import packageMetadata from './package.json' with { type: 'json' }; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
You can disable that lint rule for this file if necessary. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Example of disabling a lint rule for markdown code sample: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I had There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good now |
||
|
||
const { version } = packageMetadata; | ||
|
||
export default [ | ||
{ | ||
plugins: { 'eslint-plugin': eslintPlugin }, | ||
rules: { | ||
'eslint-plugin/require-meta-docs-url': [ | ||
'error', | ||
{ | ||
pattern: `path/to/v${version}/docs/rules/{{name}}.md`, | ||
}, | ||
], | ||
}, | ||
}, | ||
}; | ||
]; | ||
``` | ||
|
||
**package.json**: | ||
|
Uh oh!
There was an error while loading. Please reload this page.