rsnext/packages/next/compiled
Houssein Djirdeh 7a1c9eb17e
[ESLint] Introduce a new setup process when next lint is run for the first time (#26584)
This PR introduces an improved developer experience when `next lint` is run for the first time.

### Current behavior

`eslint-config-next` is a required package that must be installed before proceeding with `next lint` or `next build`:

![image](https://user-images.githubusercontent.com/12476932/123468791-43088100-d5c0-11eb-9ad0-5beb80b6c968.png)

Although this has helped many developers start using the new ESLint config, this has also resulted in a few issues:

- Users are required to install the full config (`eslint-config-next`) even if they do not use it or use the Next.js plugin directly (`eslint-plugin-next`).
  - #26348

- There's some confusion  on why `eslint-config-next` needs to be installed or how it should be used instead of `eslint-plugin-next`.
  - #26574
  - #26475
  - #26438

### New behavior

Instead of enforcing `eslint-config-next` as a required package, this PR prompts the user by asking what config they would like to start. This happens when `next lint` is run for the first time **and** if no ESLint configuration is detected in the application.

<img src="https://user-images.githubusercontent.com/12476932/124331177-e1668a80-db5c-11eb-8915-38d3dc20f5d4.gif" width="800" />

- The CLI will take care of installing `eslint` or `eslint-config-next` if either is not already installed
- Users now have the option to choose between a strict configuration (`next/core-web-vitals`) or just the base configuration (`next`)
- For users that decide to create their own ESLint configuration, or already have an existing one, **installing `eslint-config-next` will not be a requirement for `next lint` or `next build` to run**. A warning message will just show if the Next.js ESLint plugin is not detected in an ESLint config. 

  <img width="682" alt="Screen Shot 2021-06-25 at 3 02 12 PM" src="https://user-images.githubusercontent.com/12476932/123473329-6cc4a680-d5c6-11eb-9a57-d5c0b89a2732.png">

---

In addition, this PR also:

- Fixes #26348
- Updates documentation to make it more clear what approach to take for new and existing ESLint configurations
2021-08-04 21:53:15 +00:00
..
amphtml-validator feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
arg feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
async-retry Upgrade to lerna 4 (#22039) 2021-02-12 13:34:25 +01:00
async-sema feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
babel Omit svg static imports if custom webpack config is defined (#26281) 2021-06-18 00:40:22 +00:00
bfj Add stats config option (#21761) 2021-02-02 15:39:39 +00:00
cacache feat(next/image): remove sharp for wasm variant (#22253) 2021-02-18 10:23:24 +00:00
ci-info feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
cli-select [ESLint] Introduce a new setup process when next lint is run for the first time (#26584) 2021-08-04 21:53:15 +00:00
comment-json feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
compression feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
conf Upgrade eslint to the latest version (#24377) 2021-04-25 18:34:36 +00:00
content-type feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
cookie feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
cross-spawn [ESLint] Introduce a new setup process when next lint is run for the first time (#26584) 2021-08-04 21:53:15 +00:00
css-loader Upgrade jest-worker (#23077) 2021-03-16 21:08:35 +00:00
debug Upgrade jest-worker (#23077) 2021-03-16 21:08:35 +00:00
devalue feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
escape-string-regexp feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
file-loader feat: Webpack loader inlining (#21127) 2021-01-15 01:51:45 +00:00
find-cache-dir Remove experimental babel flag (#24776) 2021-05-07 19:17:45 +02:00
find-up Delay server compilation until client compilation is done in development (#22187) 2021-02-19 11:10:19 +01:00
fresh feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
gzip-size feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
http-proxy feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
ignore-loader feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
is-animated feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
is-docker feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
is-wsl feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
json5 Upgrade eslint to the latest version (#24377) 2021-04-25 18:34:36 +00:00
jsonwebtoken feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
loader-utils use official mini-css-extract-plugin and experimentalUseImportModule (#24573) 2021-05-12 16:04:01 +00:00
lodash.curry feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
lru-cache Upgrade to lerna 4 (#22039) 2021-02-12 13:34:25 +01:00
mini-css-extract-plugin Ensure externals are correct for mini-css-extract-plugin (#25340) 2021-05-23 13:15:58 +02:00
nanoid feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
neo-async feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
ora feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
postcss-flexbugs-fixes Fix css minify incorrectly duplicating variables (#27150) 2021-07-14 21:16:11 +00:00
postcss-loader Fix css minify incorrectly duplicating variables (#27150) 2021-07-14 21:16:11 +00:00
postcss-preset-env Upgrade browserslist to 4.16.6 (#24692) 2021-05-16 18:30:02 +00:00
postcss-scss fix: upgrade cssnano/postcss version (#24034) 2021-04-14 08:44:07 +00:00
recast feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
resolve-url-loader Upgrade jest-worker (#23077) 2021-03-16 21:08:35 +00:00
sass-loader feat: Webpack loader inlining (#21127) 2021-01-15 01:51:45 +00:00
schema-utils Remove experimental babel flag (#24776) 2021-05-07 19:17:45 +02:00
schema-utils3 feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
semver feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
send feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
source-map feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
string-hash feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
strip-ansi fix(link): cancel idle callback on unmount (#22072) 2021-02-11 13:51:41 -05:00
terser Update Terser (#27600) 2021-07-29 18:08:14 +00:00
text-table feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
unistore feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
web-vitals Upgrades web-vitals to v1.1.2. (#25272) 2021-07-12 16:18:51 +00:00
webpack update webpack-sources to 3.2.0 for bugfixes and performance (#27673) 2021-08-03 00:01:43 +00:00
webpack-sources feat: webpack inlining with configuration for v4 / v5 (#20598) 2021-01-13 20:59:08 -05:00
webpack-sources3 update webpack-sources to 3.2.0 for bugfixes and performance (#27673) 2021-08-03 00:01:43 +00:00