Commit graph

429 commits

Author SHA1 Message Date
Tim Neutkens
52486ceccf v11.0.2-canary.30 2021-08-11 15:59:00 +02:00
Tim Neutkens
6014b6e0f8 v11.0.2-canary.29 2021-08-11 12:46:11 +02:00
Brody McKee
4cd45aabcf
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 10:37:55 +00:00
Tim Neutkens
8cbaa409ca v11.0.2-canary.28 2021-08-10 11:01:53 +02:00
JJ Kasper
e57b959e17
v11.0.2-canary.27 2021-08-06 13:45:57 -05:00
JJ Kasper
f15d05754d
v11.0.2-canary.26 2021-08-04 22:15:26 -05:00
JJ Kasper
ca0c122f63
v11.0.2-canary.25 2021-08-02 20:00:21 -05:00
JJ Kasper
dd7a54c509
v11.0.2-canary.24 2021-07-29 21:15:13 -05:00
JJ Kasper
c63bfbe773
v11.0.2-canary.23 2021-07-28 15:19:07 -05:00
JJ Kasper
7c0f707b06
v11.0.2-canary.22 2021-07-26 12:48:27 -05:00
JJ Kasper
2cf9b462ae
v11.0.2-canary.21 2021-07-24 12:10:01 -05:00
JJ Kasper
bb779eceeb
v11.0.2-canary.20 2021-07-22 18:21:12 -05:00
JJ Kasper
5dc5a3fba8
v11.0.2-canary.19 2021-07-21 13:57:48 -05:00
JJ Kasper
a972579304
v11.0.2-canary.18 2021-07-20 12:36:49 -05:00
JJ Kasper
198046360d
v11.0.2-canary.17 2021-07-19 18:31:57 -05:00
JJ Kasper
7644c17f43
v11.0.2-canary.16 2021-07-15 16:42:36 -05:00
JJ Kasper
86e3ea8e33
v11.0.2-canary.15 2021-07-14 09:16:46 -05:00
JJ Kasper
8088416082
v11.0.2-canary.14 2021-07-13 09:35:56 -05:00
JJ Kasper
ae6b0a1b39
v11.0.2-canary.13 2021-07-12 17:18:45 -05:00
JJ Kasper
4e8c2a6aa3
v11.0.2-canary.12 2021-07-12 12:18:52 -05:00
Tim Neutkens
1c8a7d55c1 v11.0.2-canary.11 2021-07-11 16:10:30 +02:00
Tim Neutkens
ad56e81f4d v11.0.2-canary.10 2021-07-10 22:29:39 +02:00
JJ Kasper
17582014fc
v11.0.2-canary.9 2021-07-08 20:13:53 -05:00
JJ Kasper
ad3b7409c5
v11.0.2-canary.8 2021-07-08 15:44:44 -05:00
Tim Neutkens
1dd19f5776 v11.0.2-canary.7 2021-07-07 12:39:42 +02:00
JJ Kasper
697756f8ce
v11.0.2-canary.6 2021-07-06 18:11:34 -05:00
JJ Kasper
4fbf961c79
v11.0.2-canary.5 2021-07-02 18:27:50 -05:00
JJ Kasper
138b9ddf99
v11.0.2-canary.4 2021-07-01 17:45:55 -05:00
JJ Kasper
d11589d677
v11.0.2-canary.3 2021-06-28 10:50:14 -05:00
Tim Neutkens
2f03bfa66c v11.0.2-canary.2 2021-06-25 14:01:34 +02:00
Tim Neutkens
4da94a3f53 v11.0.2-canary.1 2021-06-25 11:12:59 +02:00
JJ Kasper
ccf189fbe1
v11.0.2-canary.0 2021-06-23 19:35:20 -05:00
JJ Kasper
e969d22699
v11.0.1 2021-06-22 14:51:49 -05:00
JJ Kasper
30ee9e71b7
v11.0.1-canary.8 2021-06-22 13:54:35 -05:00
JJ Kasper
9fefd3cc1f
v11.0.1-canary.7 2021-06-22 13:00:23 -05:00
Tim Neutkens
075139a23d v11.0.1-canary.6 2021-06-21 13:32:34 +02:00
JJ Kasper
94f7bfca99
v11.0.1-canary.5 2021-06-18 15:00:12 -05:00
JJ Kasper
b4e0eb0bc4
v11.0.1-canary.4 2021-06-17 20:08:52 -05:00
JJ Kasper
a403c4cf95
v11.0.1-canary.3 2021-06-17 12:44:11 -05:00
JJ Kasper
2ac47d2193
v11.0.1-canary.2 2021-06-16 15:25:50 -05:00
JJ Kasper
3c65c34dc8
v11.0.1-canary.1 2021-06-16 11:07:06 -05:00
JJ Kasper
da204bd463
v11.0.1-canary.0 2021-06-15 13:50:12 -05:00
JJ Kasper
0ca24563be
v11.0.0 2021-06-15 09:51:13 -05:00
JJ Kasper
47b96d8ae5
v10.2.4-canary.19 2021-06-15 09:42:16 -05:00
JJ Kasper
7d339b6cd8
v10.2.4-canary.18 2021-06-15 09:24:31 -05:00
JJ Kasper
d19935c302
v10.2.4-canary.17 2021-06-14 20:39:08 -05:00
Tim Neutkens
3b8c2afbfe v10.2.4-canary.16 2021-06-12 13:36:41 +02:00
JJ Kasper
75fdad636e
v10.2.4-canary.15 2021-06-11 16:01:27 -05:00
JJ Kasper
e7ba3eb659
v10.2.4-canary.14 2021-06-11 09:45:36 -05:00
JJ Kasper
e6da19266c
v10.2.4-canary.13 2021-06-10 17:48:46 -05:00