Skip to content
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

Node support and entry point #30

Open
arcticicestudio opened this issue Mar 30, 2021 · 0 comments
Open

Node support and entry point #30

arcticicestudio opened this issue Mar 30, 2021 · 0 comments

Comments

@arcticicestudio
Copy link
Contributor

In ESLint v7 many rules related to Node have been deprecated and moved into eslint-plugin-node.

The @arcticicestudio/eslint-config-base package already includes support for Node, but enabling eslint-plugin-node by default is not an option. Instead it will be available through a shareable configuration entry point that

The new entry point will be available as @arcticicestudio/eslint-config/node and can be composed with all other available entry points to inherit their rules.
This feature will add the eslint-plugin-node package as new peer dependency for @arcticicestudio/eslint-config.

arcticicestudio added a commit that referenced this issue Mar 31, 2021
ESLint and most of the used plugins already released new major versions.
Trying to use later versions of these plugins as well as ESLint itself
caused error when using npm v7 because peer dependencies are installed
automatically [1] now, which is a fantastic change, but also broke and
blocked the usage of the configuration packages due to outdated
`peerDependencies` like `eslint@^6`.

>> Core

The latest version 7 comes with great features and improvements.
See the official v7 migration guide [2] for all details.

- Update ESLint package version - updated from `v6.2.0` to
  `v7.23.0` [3].
- Allow to define additional file extensions in configuration
  packages - files matched by `overrides[].files` are now linted by
  default [4] which allows to add extensions like `*.ts` and `*.tsx` to
  `@arcticicestudio/eslint-config-typescript` without the need to
  specify this override over and over again in each project.
- Remove deprecated rules** - some rules have been deprecated [5] and
  have been removed in favor of the support for `eslint-plugin-node`
  like documented in GH-30.
  - `callback-return` [6] → `node/callback-return` [7]
  - `global-require` [8] → `node/global-require` [9]
  - `handle-callback-err` [10] → `node/handle-callback-err` [11]
  - `no-mixed-requires` [12] → `node/no-mixed-requires` [13]
  - `no-new-require` [14] → `node/no-new-require` [15]
  - `no-path-concat` [16] → `node/no-path-concat` [17]
  - `no-process-env` [18] → `node/no-process-env` [19]
  - `no-process-exit` [20] → `node/no-process-exit` [21]
  - `no-restricted-modules` [22] → `node/no-restricted-modules` [23]
  - `no-sync` [24] → `node/no-sync` [25]
- Adapt new recommended rules - some rules have been added and enabled
  on the `eslint:recommended` rule set [26] and have been added to
  `@arcticicestudio/eslint-config-base` with `error` level:
  - `no-dupe-else-if` [27]
  - `no-import-assign` [28]
  - `no-setter-return` [29]

>> Plugins & Dependencies

>>> `@arcticicestudio/eslint-config`

- eslint-config-prettier [30] - Bumped version from `v6.0.0` to
  `v8.1.0` [31]. As of version `8.0.0` all rule sets have been merged
  into the main `prettier` set [32]. Therefore the additional
  `prettier/react` set has been removed from the `extends` array of the
  Prettier specific rules.
- eslint-find-rules [33] - Bumped version from `v3.4.0` to
  `v3.6.1` [34].
- eslint-plugin-import [35] - Bumped minimum version from `v2.18.2`
  to `v2.22.1` [36].
- eslint-plugin-jsx-a11y [37] - Bumped minimum version from `v6.2.3`
  to `v6.4.1` [38].
- eslint-plugin-prettier [39] - Bumped minimum version from `v3.1.0` to
  `v3.3.1` [40].
- eslint-plugin-react [41] - Bumped minimum version from `v7.14.3` to
  `v7.23.1` [42]. This includes new rules and improvements to existing
  ones:
  - Added new `react/jsx-no-useless-fragment` [43] rule with `error`
    level (introduced in `v7.15.0` [44]) that disallows unnecessary
    fragments.
  - Added the new `static-variables` option to the
    `react/sort-comp` [45] rule (introduced in `v7.15.0` [44]).
  - Added new `react/jsx-newline` [46] rule (introduced in
    `v7.22.0` [47]) and disabled by default.
  - Added new `react/jsx-no-constructed-context-values` [48] rule
    (introduced in `v7.22.0` [47]) and enabled by default to prevent
    React contexts from taking non-stable values.
      "React Context, and all its child nodes and Consumers are
       rerendered whenever the value prop changes. Because each
       Javascript object carries its own identity, things like object
       expressions (`{foo: "bar"}`) or function expressions get a new
       identity on every run through the component. This makes the
       context think it has gotten a new object and can cause needless
       rerenders and unintended consequences.
       This can be a pretty large performance hit because not only will
       it cause the context providers and consumers to rerender with all
       the elements in its subtree, the processing for the tree scan
       React does to render the provider and find consumers is also
       wasted."
  - Added `enforceDynamicLinks` option with value `always` for
    `react/jsx-no-target-blank` [49] rule (introduced in `v7.9.0` [50])
  - Added `react/no-unstable-nested-components` [51] rule and enabled by
    default to prevent creating unstable components inside components.
      "Creating components inside components without memoization leads
       to unstable components. The nested component and all its children
       are recreated during each re-render. Given stateful children of
       the nested component will lose their state on each re-render.
       React reconcilation performs element type comparison with
       reference equality [52]. The reference to the same element
       changes on each re-render when defining components inside the
       render block. This leads to complete recreation of the current
       node and all its children. As a result the virtual DOM has to do
       extra unnecessary work and possible bugs are introduced.
  - Added `forbidDefaultForRequired` option with value `true` for
    `react/require-default-props` [53] rule (introduced in
    `v7.5.0` [54])
- eslint-plugin-react-hooks [55] - Bump minimum version from `v2.0.0` to
  `v4.2.0` [56].

>>> `@arcticicestudio/eslint-config-base`

- confusing-browser-globals [57] - Bumped minimum version from `v1.0.8`
  to `v1.0.10`.
- eslint-find-rules [33] - Bumped version from `v3.4.0` to
  `v3.6.1` [34].
- eslint-plugin-import [35] - Bumped minimum version from `v2.18.2` to
  `v2.22.1` [36].

>>> `@arcticicestudio/eslint-config-typescript`

- @typescript-eslint/eslint-plugin [58] - Bumped minimum version from
  `v2.0.0` to `v4.20.0` [59].
- @typescript-eslint/parser [60] - Bumped minimum version from `v2.0.0`
  to `v4.20.0` [59].
- typescript [61] - Bumped minimum version from `v3.5.3` to
  `v4.2.3` [62].

[1]: https://github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli/#user-content-breaking-changes
[2]: https://eslint.org/docs/user-guide/migrating-to-7.0.0
[3]: eslint/eslint@v6.2.0....v7.23.0
[4]: https://eslint.org/docs/user-guide/migrating-to-7.0.0#lint-files-matched-by-overridesfiles-by-default
[5]: https://eslint.org/docs/user-guide/migrating-to-7.0.0#nodejscommonjs-rules-have-been-deprecated
[6]: https://eslint.org/docs/rules/callback-return
[7]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/callback-return.md
[8]: https://eslint.org/docs/rules/global-require
[9]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/global-require.md
[10]: https://eslint.org/docs/rules/handle-callback-err
[11]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/handle-callback-err.md
[12]: https://eslint.org/docs/rules/no-mixed-requires
[13]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-mixed-requires.md
[14]: https://eslint.org/docs/rules/no-new-require
[15]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-new-require.md
[16]: https://eslint.org/docs/rules/no-path-concat
[17]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-path-concat.md
[18]: https://eslint.org/docs/rules/no-process-env
[19]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-process-env.md
[20]: https://eslint.org/docs/rules/no-process-exit
[21]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-process-exit.md
[22]: https://eslint.org/docs/rules/no-restricted-modules
[23]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-restricted-modules.md
[24]: https://eslint.org/docs/rules/no-sync
[25]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-sync.md
[26]: https://eslint.org/docs/user-guide/migrating-to-7.0.0#eslintrecommended-has-been-updated
[27]: https://eslint.org/docs/rules/no-dupe-else-if
[28]: https://eslint.org/docs/rules/no-import-assign
[29]: https://eslint.org/docs/rules/no-setter-return
[30]: https://github.com/prettier/eslint-config-prettier
[31]: prettier/eslint-config-prettier@v6.0.0...v8.1.0
[32]: https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21
[33]: https://github.com/sarbbottam/eslint-find-rules
[34]: sarbbottam/eslint-find-rules@v3.4.0...v3.6.1
[35]: https://github.com/benmosher/eslint-plugin-import
[35]: https://github.com/benmosher/eslint-plugin-import
[36]: import-js/eslint-plugin-import@v2.18.2...v2.22.1
[37]: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y
[38]: jsx-eslint/eslint-plugin-jsx-a11y@v6.2.3...v6.4.1
[39]: https://github.com/prettier/eslint-plugin-prettier
[40]: prettier/eslint-plugin-prettier@v3.1.0...v3.3.1
[41]: https://github.com/yannickcr/eslint-plugin-react
[42]: jsx-eslint/eslint-plugin-react@v7.14....v7.23.1
[43]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
[44]: https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#7150---2019-09-30
[45]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md
[46]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-newline.md
[47]: https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#7220---20201229
[48]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-constructed-context-values.md
[49]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
[50]: https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#790---2018-06-03
[51]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
[52]: https://github.com/facebook/react/blob/v16.13.1/packages/react-reconciler/src/ReactChildFiber.js#L407
[53]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md
[54]: https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#750---2017-11-18
[55]: https://github.com/facebook/react/tree/master/packages/eslint-plugin-react-hooks
[56]: https://github.com/facebook/react/blob/master/packages/eslint-plugin-react-hooks/CHANGELOG.md#420
[57]: https://github.com/facebook/create-react-app/tree/master/packages/confusing-browser-globals
[58]: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
[59]: typescript-eslint/typescript-eslint@v2.0.0...v4.20.0
[60]: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser
[61]: https://github.com/microsoft/TypeScript
[62]: microsoft/TypeScript@v3.5.3...v4.2.3

Co-authored-by: Sven Greb <[email protected]>

GH-31
arcticicestudio added a commit that referenced this issue Mar 31, 2021
ESLint and most of the used plugins already released new major versions.
Trying to use later versions of these plugins as well as ESLint itself
caused error when using npm v7 because peer dependencies are installed
automatically [1] now, which is a fantastic change, but also broke and
blocked the usage of the configuration packages due to outdated
`peerDependencies` like `eslint@^6`.

>> Core

The latest version 7 comes with great features and improvements.
See the official v7 migration guide [2] for all details.

- Update ESLint package version - updated from `v6.2.0` to
  `v7.23.0` [3].
- Allow to define additional file extensions in configuration
  packages - files matched by `overrides[].files` are now linted by
  default [4] which allows to add extensions like `*.ts` and `*.tsx` to
  `@arcticicestudio/eslint-config-typescript` without the need to
  specify this override over and over again in each project.
- Remove deprecated rules** - some rules have been deprecated [5] and
  have been removed in favor of the support for `eslint-plugin-node`
  like documented in GH-30.
  - `callback-return` [6] → `node/callback-return` [7]
  - `global-require` [8] → `node/global-require` [9]
  - `handle-callback-err` [10] → `node/handle-callback-err` [11]
  - `no-mixed-requires` [12] → `node/no-mixed-requires` [13]
  - `no-new-require` [14] → `node/no-new-require` [15]
  - `no-path-concat` [16] → `node/no-path-concat` [17]
  - `no-process-env` [18] → `node/no-process-env` [19]
  - `no-process-exit` [20] → `node/no-process-exit` [21]
  - `no-restricted-modules` [22] → `node/no-restricted-modules` [23]
  - `no-sync` [24] → `node/no-sync` [25]
- Adapt new recommended rules - some rules have been added and enabled
  on the `eslint:recommended` rule set [26] and have been added to
  `@arcticicestudio/eslint-config-base` with `error` level:
  - `no-dupe-else-if` [27]
  - `no-import-assign` [28]
  - `no-setter-return` [29]

>> Plugins & Dependencies

>>> `@arcticicestudio/eslint-config`

- eslint-config-prettier [30] - Bumped version from `v6.0.0` to
  `v8.1.0` [31]. As of version `8.0.0` all rule sets have been merged
  into the main `prettier` set [32]. Therefore the additional
  `prettier/react` set has been removed from the `extends` array of the
  Prettier specific rules.
- eslint-find-rules [33] - Bumped version from `v3.4.0` to
  `v3.6.1` [34].
- eslint-plugin-import [35] - Bumped minimum version from `v2.18.2`
  to `v2.22.1` [36].
- eslint-plugin-jsx-a11y [37] - Bumped minimum version from `v6.2.3`
  to `v6.4.1` [38].
- eslint-plugin-prettier [39] - Bumped minimum version from `v3.1.0` to
  `v3.3.1` [40].
- eslint-plugin-react [41] - Bumped minimum version from `v7.14.3` to
  `v7.23.1` [42]. This includes new rules and improvements to existing
  ones:
  - Added new `react/jsx-no-useless-fragment` [43] rule with `error`
    level (introduced in `v7.15.0` [44]) that disallows unnecessary
    fragments.
  - Added the new `static-variables` option to the
    `react/sort-comp` [45] rule (introduced in `v7.15.0` [44]).
  - Added new `react/jsx-newline` [46] rule (introduced in
    `v7.22.0` [47]) and disabled by default.
  - Added new `react/jsx-no-constructed-context-values` [48] rule
    (introduced in `v7.22.0` [47]) and enabled by default to prevent
    React contexts from taking non-stable values.
      "React Context, and all its child nodes and Consumers are
       rerendered whenever the value prop changes. Because each
       Javascript object carries its own identity, things like object
       expressions (`{foo: "bar"}`) or function expressions get a new
       identity on every run through the component. This makes the
       context think it has gotten a new object and can cause needless
       rerenders and unintended consequences.
       This can be a pretty large performance hit because not only will
       it cause the context providers and consumers to rerender with all
       the elements in its subtree, the processing for the tree scan
       React does to render the provider and find consumers is also
       wasted."
  - Added `enforceDynamicLinks` option with value `always` for
    `react/jsx-no-target-blank` [49] rule (introduced in `v7.9.0` [50])
  - Added `react/no-unstable-nested-components` [51] rule and enabled by
    default to prevent creating unstable components inside components.
      "Creating components inside components without memoization leads
       to unstable components. The nested component and all its children
       are recreated during each re-render. Given stateful children of
       the nested component will lose their state on each re-render.
       React reconcilation performs element type comparison with
       reference equality [52]. The reference to the same element
       changes on each re-render when defining components inside the
       render block. This leads to complete recreation of the current
       node and all its children. As a result the virtual DOM has to do
       extra unnecessary work and possible bugs are introduced.
  - Added `forbidDefaultForRequired` option with value `true` for
    `react/require-default-props` [53] rule (introduced in
    `v7.5.0` [54])
- eslint-plugin-react-hooks [55] - Bump minimum version from `v2.0.0` to
  `v4.2.0` [56].

>>> `@arcticicestudio/eslint-config-base`

- confusing-browser-globals [57] - Bumped minimum version from `v1.0.8`
  to `v1.0.10`.
- eslint-find-rules [33] - Bumped version from `v3.4.0` to
  `v3.6.1` [34].
- eslint-plugin-import [35] - Bumped minimum version from `v2.18.2` to
  `v2.22.1` [36].

>>> `@arcticicestudio/eslint-config-typescript`

- @typescript-eslint/eslint-plugin [58] - Bumped minimum version from
  `v2.0.0` to `v4.20.0` [59].
- @typescript-eslint/parser [60] - Bumped minimum version from `v2.0.0`
  to `v4.20.0` [59].
- typescript [61] - Bumped minimum version from `v3.5.3` to
  `v4.2.3` [62].

[1]: https://github.blog/2020-10-13-presenting-v7-0-0-of-the-npm-cli/#user-content-breaking-changes
[2]: https://eslint.org/docs/user-guide/migrating-to-7.0.0
[3]: eslint/eslint@v6.2.0....v7.23.0
[4]: https://eslint.org/docs/user-guide/migrating-to-7.0.0#lint-files-matched-by-overridesfiles-by-default
[5]: https://eslint.org/docs/user-guide/migrating-to-7.0.0#nodejscommonjs-rules-have-been-deprecated
[6]: https://eslint.org/docs/rules/callback-return
[7]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/callback-return.md
[8]: https://eslint.org/docs/rules/global-require
[9]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/global-require.md
[10]: https://eslint.org/docs/rules/handle-callback-err
[11]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/handle-callback-err.md
[12]: https://eslint.org/docs/rules/no-mixed-requires
[13]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-mixed-requires.md
[14]: https://eslint.org/docs/rules/no-new-require
[15]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-new-require.md
[16]: https://eslint.org/docs/rules/no-path-concat
[17]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-path-concat.md
[18]: https://eslint.org/docs/rules/no-process-env
[19]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-process-env.md
[20]: https://eslint.org/docs/rules/no-process-exit
[21]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-process-exit.md
[22]: https://eslint.org/docs/rules/no-restricted-modules
[23]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-restricted-modules.md
[24]: https://eslint.org/docs/rules/no-sync
[25]: https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-sync.md
[26]: https://eslint.org/docs/user-guide/migrating-to-7.0.0#eslintrecommended-has-been-updated
[27]: https://eslint.org/docs/rules/no-dupe-else-if
[28]: https://eslint.org/docs/rules/no-import-assign
[29]: https://eslint.org/docs/rules/no-setter-return
[30]: https://github.com/prettier/eslint-config-prettier
[31]: prettier/eslint-config-prettier@v6.0.0...v8.1.0
[32]: https://github.com/prettier/eslint-config-prettier/blob/main/CHANGELOG.md#version-800-2021-02-21
[33]: https://github.com/sarbbottam/eslint-find-rules
[34]: sarbbottam/eslint-find-rules@v3.4.0...v3.6.1
[35]: https://github.com/benmosher/eslint-plugin-import
[35]: https://github.com/benmosher/eslint-plugin-import
[36]: import-js/eslint-plugin-import@v2.18.2...v2.22.1
[37]: https://github.com/jsx-eslint/eslint-plugin-jsx-a11y
[38]: jsx-eslint/eslint-plugin-jsx-a11y@v6.2.3...v6.4.1
[39]: https://github.com/prettier/eslint-plugin-prettier
[40]: prettier/eslint-plugin-prettier@v3.1.0...v3.3.1
[41]: https://github.com/yannickcr/eslint-plugin-react
[42]: jsx-eslint/eslint-plugin-react@v7.14....v7.23.1
[43]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-useless-fragment.md
[44]: https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#7150---2019-09-30
[45]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/sort-comp.md
[46]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-newline.md
[47]: https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#7220---20201229
[48]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-constructed-context-values.md
[49]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-target-blank.md
[50]: https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#790---2018-06-03
[51]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md
[52]: https://github.com/facebook/react/blob/v16.13.1/packages/react-reconciler/src/ReactChildFiber.js#L407
[53]: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-default-props.md
[54]: https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#750---2017-11-18
[55]: https://github.com/facebook/react/tree/master/packages/eslint-plugin-react-hooks
[56]: https://github.com/facebook/react/blob/master/packages/eslint-plugin-react-hooks/CHANGELOG.md#420
[57]: https://github.com/facebook/create-react-app/tree/master/packages/confusing-browser-globals
[58]: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
[59]: typescript-eslint/typescript-eslint@v2.0.0...v4.20.0
[60]: https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser
[61]: https://github.com/microsoft/TypeScript
[62]: microsoft/TypeScript@v3.5.3...v4.2.3

Co-authored-by: Sven Greb <[email protected]>

Closes GH-31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant