Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

eslint-config-env

jaydenseric5.7kMIT23.0.2

ESLint config optimized for authoring packages that adapts to the project environment.

eslint, config, env, node, babel, prettier, react, hooks, next, esm, mjs, jsdoc, md, markdown

readme

eslint-config-env

npm version CI status

ESLint config optimized for authoring packages that adapts to the project environment, supporting:

Install

To install eslint-config-env and it’s peer dependencies with npm, run:

npm install eslint-config-env eslint-plugin-node eslint-plugin-import eslint-plugin-jsdoc --save-dev

Configure ESLint in your project:

{
  "extends": ["env"]
}

Also follow the setup instructions that are relevant to your project below…

Node.js

Every project must specify supported Node.js versions in the package.json engines.node field.

Browsers

If it’s not a Babel project, also install eslint-plugin-compat:

npm install eslint-plugin-compat --save-dev

Supported browsers must be specified in the package.json browserslist field.

Babel

Also install @babel/eslint-parser:

npm install @babel/eslint-parser --save-dev

Prettier

Also install eslint-plugin-prettier and eslint-config-prettier:

npm install eslint-plugin-prettier eslint-config-prettier --save-dev

React

Also install eslint-plugin-react and eslint-plugin-react-hooks:

npm install eslint-plugin-react eslint-plugin-react-hooks --save-dev

Next.js

Follow the Babel setup instructions.

Also install @next/eslint-plugin-next:

npm install @next/eslint-plugin-next --save-dev

jsdoc-md

A jsdoc-md project does not require additional setup.

changelog

eslint-config-env changelog

23.0.2

Patch

  • Updated dev dependencies.
  • Updated the ESLint parserOptions.ecmaVersion config from 2021 to "latest".
  • Removed a comment in the .editorconfig file.

23.0.1

Patch

  • Updated dev dependencies.
  • Simplified package scripts.
  • Configured Prettier option singleQuote to the default, false.
  • Configured the jsdoc/require-description rule option checkConstructors to false.

23.0.0

Major

  • Updated Node.js support to ^12.20.0 || ^14.13.1 || >= 16.0.0.

Patch

22.0.0

Major

  • Updated Node.js support to >= 12.20.
  • Updated dev dependencies, some of which require newer Node.js versions than previously supported.

Patch

  • Updated the eslint-plugin-jsdoc peer dependency to 34 - 36.
  • Added a link to ESLint configuration documentation in the readme.

21.0.0

Major

Patch

  • Updated dev dependencies.
  • Amended the changelog entry for v20.0.0.

20.0.1

Patch

20.0.0

Major

  • Updated Node.js support to >= 12.
  • Updated the eslint-plugin-jsdoc peer dependency to ^34.0.0, via #4.
  • Updated dev dependencies, some of which require newer Node.js versions than previously supported.

Patch

  • Updated the GitHub Actions CI config to test Node.js versions v12, v14, v16.
  • Readme tweaks.
  • The file changelog.md is no longer published.

19.0.2

Patch

  • Updated the eslint-plugin-jsdoc peer dependency to 25 - 33.
  • Updated dev dependencies.
  • Updated GitHub Actions CI config to also test Node.js v16.

19.0.1

Patch

  • Updated dev dependencies.
  • Removed the semver dependency and some package.json engines.node field checks that are no longer necessary for the currently supported Node.js versions.

19.0.0

Major

Patch

18.0.1

Patch

  • For Babel environments, prevent a parsing error when linting a file not under the scope of a Babel config file.

18.0.0

Major

Patch

  • Updated dev dependencies.
  • Updated the Next.js environment setup instructions.

17.0.0

Major

  • Added more (auto-fixable) JSDoc tag name preferences for non jsdoc-md projects.

Patch

  • Updated the JSDoc tag name preference config to support jsdoc-md v9.0.0.
  • Misc. refactoring.
  • Improved error messages.
  • Improved internal JSDoc.

16.0.0

Major

Patch

  • Updated dependencies.
  • Updated GitHub Actions CI config:
    • Updated actions/checkout to v2.
    • Updated actions/setup-node to v2.
    • Also test Node.js v15.
    • Don’t specify the CI environment variable as it’s set by default.
  • Removed npm-debug.log from the .gitignore file as npm v4.2.0+ doesn’t create it in the current working directory.
  • Updated a Node.js docs URL in a comment.

15.0.1

Patch

15.0.0

Major

Patch

14.0.4

Patch

14.0.3

Patch

  • Updated dev dependencies.
  • Allow the @fires JSDoc tag in jsdoc-md projects as it’s supported in v7.0.0.

14.0.2

Patch

  • Updated the eslint-plugin-jsdoc peer dependency to 15.11 - 27.
  • Updated dev dependencies.
  • Updated the EditorConfig.
  • Stopped testing with Node.js v13.

14.0.1

Patch

  • Updated the package engines.node field to ^10.13.0 || >= 12.0.0. This is mostly determined by what Node.js versions dev dependencies such as eslint and prettier support.
  • Updated the eslint-plugin-jsdoc peer dependency to 15.11 - 26.
  • Updated dev dependencies.

14.0.0

Major

Patch

  • Updated the eslint peer dependency to 6 - 7.
  • Updated the eslint-plugin-jsdoc peer dependency to 15.11 - 25.
  • Updated dependencies.
  • Removed disabling the require-atomic-updates rule, as it is no longer part of the eslint:recommended rule set.
  • Fixed a comment typo.
  • Fixed a v13.0.6 changelog entry typo.

13.0.6

Patch

  • Updated the eslint-plugin-jsdoc peer dependency to 15.11 - 24.
  • Updated dependencies.
  • Also run GitHub Actions with Node.js v14.

13.0.5

Patch

  • Updated the eslint-plugin-jsdoc peer dependency to 15.11 - 23.
  • Updated dependencies.
  • Updated the prettier dev dependency, config and package test:prettier script.
  • Ensure GitHub Actions run on pull request.

13.0.4

Patch

  • Updated the eslint-plugin-jsdoc peer dependency to 15.11 - 22, fixing #1.
  • Updated dependencies and dev dependencies.

13.0.3

Patch

13.0.2

Patch

  • Updated the eslint-plugin-jsdoc peer dependency to 15.11 - 20, and updated it’s dev dependency.

13.0.1

Patch

13.0.0

Major

  • Updated Node.js support from v8.10+ to v10+.
  • Updated dependencies, some of which require Node.js >= v10.

12.0.1

Patch

  • Removed the require-await rule as there are valid use cases for async functions that don’t contain await, particularly around errors and rejection.

12.0.0

Major

Minor

  • Setup GitHub Sponsors funding:
    • Added .github/funding.yml to display a sponsor button in GitHub.
    • Added a package.json funding field to enable npm CLI funding features.

Patch

  • Updated dependencies.
  • Fixed a package.json type field value of commonjs setting parserOptions.sourceType to commonjs, instead of script.
  • Remove package-lock.json from ignore files, as it is disabled via .npmrc anyway.
  • Test Node.js v13 in CI GitHub Actions.

11.0.1

Patch

11.0.0

Major

  • Updated the minimum supported Node.js version from v8.3 to v8.10, to match ESLint’s level of support.

Patch

  • Updated dependencies.
  • Updated the eslint-plugin-jsdoc peer dependency to 15.11 - 17.
  • Added a gitattributes file to enforce LF line endings in a Windows environment.
  • Use double instead of single quotes in the test:prettier package script to support Windows.

10.0.0

Major

Patch

  • Updated the read-pkg-up dependency and resolved it’s breaking changes.
  • Removed a redundant @private JSDoc tag.

9.1.0

Minor

Patch

  • Updated dev dependencies.
  • Use GitHub instead of Travis for CI.

9.0.0

Major

  • Enabled the no-console rule, erroring on console.log but allowing info, warn and error.

Patch

  • Updated dependencies.

8.0.0

Major

7.0.1

Patch

  • Fixed import linting for Next.js projects.

7.0.0

Major

Patch

6.0.0

Major

Minor

  • Bump the parserOptions.ecmaVersion config from 2018 to 2019.

Patch

5.0.0

Major

  • Updated dependencies and peer dependencies.
  • Dropped support for Node.js v6 and v7.

Patch

  • Reduced the size of the published package.json by moving dev tool config to files. This also prevents editor extensions such as Prettier and ESLint from detecting config and attempting to operate when opening package files installed in node_modules.
  • Ensure .js files are linted on commit.

4.0.0

Major

  • Enabled the react-hooks/exhaustive-deps rule.

Patch

  • Updated dev dependencies.
  • Added hooks to the package keywords.

3.0.0

Major

Patch

2.0.0

Major

Patch

  • Updated dev dependencies.

1.2.1

Patch

1.2.0

Minor

  • Removed the quotes rule, to prevent conflicts with Prettier config different to singleQuote: true.
  • Added esm and mjs keywords to the package.

Patch

  • Updated dependencies.
  • Updated package scripts and config for the new husky version.
  • Prettier lint .yml files.
  • Ensure the readme Travis build status badge only tracks master branch.
  • Use Badgen instead of shields.io for the npm version badge.

1.1.0

Minor

  • Support Node.js v6+, from v6.4+.

Patch

  • Updated dependencies.
  • Changelog version entries now have “Major”, “Minor” and “Patch” subheadings.

1.0.0

Major

  • Updated eslint-plugin-node peer dependency from ^6.0.0 to ^7.0.0 and support the new API.

Patch

  • Updated dev dependencies.

0.5.0

Minor

  • Support repos with multiple packages. Instead of assuming the CWD is at or below the package directory, config is derived from the first package.json above the nested node_modules eslint-config-env is installed in.

0.4.0

Minor

  • Throw an error if the eslint peer dependency is not a project dev dependency.
  • New browser project setup:
  • Support Next.js projects:
    • parserOptions.sourceType is module, as Next.js only supports ESM in .js files. Once Next.js updates to webpack >= 4 this will be reverted and .mjs should be used for ESM source files instead.
    • Disabled the react/react-in-jsx-scope rule, as Next.js uses babel-plugin-react-require.
  • Rules preferring modern ES syntax only apply if the syntax is supported:
    • For Babel projects, support is assumed.
    • For non-Babel browser projects, no support is assumed.
    • For non-Babel Node.js projects, support for each syntax is determined against the package.json engines.node field (now documented as required for all projects).

Patch

0.3.0

Major

  • Updated peer dependencies.

Patch

  • Updated dev dependencies.

0.2.0

Major

  • Updated preferred JSDoc tag synonyms:
    • @param
    • @prop
    • @returns

Patch

  • Updated dependencies.

0.1.1

Patch

  • Fix a crash when a package is missing peerDependencies, dependencies or devDependencies fields.

0.1.0

Initial release.