2020-05-07 07:36:01 +02:00
|
|
|
{
|
|
|
|
"name": "@next/eslint-plugin-next",
|
2021-10-01 17:25:21 +02:00
|
|
|
"version": "11.1.3-canary.41",
|
2020-05-07 07:36:01 +02:00
|
|
|
"description": "ESLint plugin for NextJS.",
|
|
|
|
"main": "lib/index.js",
|
|
|
|
"license": "MIT",
|
|
|
|
"repository": {
|
2020-05-27 23:51:11 +02:00
|
|
|
"url": "vercel/next.js",
|
2020-05-07 07:36:01 +02:00
|
|
|
"directory": "packages/eslint-plugin-next"
|
Add rootDir setting to eslint-plugin-next (#27918)
## Introduction
This PR enables setting a `rootDir` for a Next.js project, and follows the same pattern used by [`@typescript-eslint/parser`](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsproject).
## Details
Previously, users had to pass paths to the rule itself.
```js
module.exports = {
rules: {
"@next/next/no-html-link-for-pages": [
"error",
// This could be a string, or array of strings.
"/packages/my-app/pages",
],
},
};
```
With this PR, this has been simplified (the previous implementation still works as expected).
```js
module.exports = {
settings: {
next: {
rootDir: "/packages/my-app",
},
},
rules: {
"@next/next/no-html-link-for-pages": "error",
},
};
```
Further, this rule allows the use of globs, again aligning with `@typescript-eslint/parser`.
```js
module.exports = {
settings: {
next: {
// Globs
rootDir: "/packages/*",
rootDir: "/packages/{app-a,app-b}",
// Arrays
rootDir: ["/app-a", "/app-b"],
// Arrays with globs
rootDir: ["/main-app", "/other-apps/*"],
},
};
```
This enables users to either provide per-workspace configuration with overrides, or to use globs for situations like monorepos where the apps share a domain (micro-frontends).
This doesn't solve, but improves https://github.com/vercel/next.js/issues/26330.
## Feature
- [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`
## Documentation / Examples
- [x] Make sure the linting passes
2021-08-11 12:37:55 +02:00
|
|
|
},
|
|
|
|
"files": [
|
|
|
|
"lib"
|
|
|
|
],
|
|
|
|
"dependencies": {
|
|
|
|
"glob": "7.1.7"
|
|
|
|
},
|
|
|
|
"devDependencies": {
|
|
|
|
"@types/eslint": "7.28.0"
|
2020-05-07 07:36:01 +02:00
|
|
|
}
|
|
|
|
}
|