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

Package detail

@moxy/eslint-config-base

moxystudio989MIT13.1.0

MOXY's ESLint base configuration

eslint-config, eslintconfig, eslint, lint, linter, style, base

readme

eslint-config-base

NPM version Downloads Dependency status Dev Dependency status

MOXY's ESLint base configuration.

Installation

$ npm install --save-dev eslint @moxy/eslint-config-base

Usage

Create a .eslintrc.json file in the project root and extend from one of these base configurations:

  • @moxy/eslint-config-base - Latest ECMAScript version without modules.
  • @moxy/eslint-config-base/esm - Latest ECMAScript version with ECMAScript modules.
  • @moxy/eslint-config-base/cjs - Latest ECMAScript version with CommonJS modules.

Instead of the latest ECMAScript version (2020), you may target specific versions of ECMAScript by using their configurations instead.

<summary>List of all base configurations</summary>
  • @moxy/eslint-config-base/es2015 - ECMAScript 2015 (aka es6) without modules.
  • @moxy/eslint-config-base/es2016 - ECMAScript 2016 (aka es7) without modules.
  • @moxy/eslint-config-base/es2017 - ECMAScript 2017 (aka es8) without modules.
  • @moxy/eslint-config-base/es2018 - ECMAScript 2018 (aka es9) without modules.
  • @moxy/eslint-config-base/es2019 - ECMAScript 2019 (aka es10) without modules.
  • @moxy/eslint-config-base/es2020 - ECMAScript 2020 (aka es11) without modules.
  • @moxy/eslint-config-base/esm/es2015 - ECMAScript 2015 (aka es6) with ECMAScript modules.
  • @moxy/eslint-config-base/esm/es2016 - ECMAScript 2016 (aka es7) with ECMAScript modules.
  • @moxy/eslint-config-base/esm/es2017 - ECMAScript 2017 (aka es8) with ECMAScript modules.
  • @moxy/eslint-config-base/esm/es2018 - ECMAScript 2018 (aka es9) with ECMAScript modules.
  • @moxy/eslint-config-base/esm/es2019 - ECMAScript 2019 (aka es10) with ECMAScript modules.
  • @moxy/eslint-config-base/esm/es2020 - ECMAScript 2020 (aka es11) with ECMAScript modules.
  • @moxy/eslint-config-base/cjs/es2015 - ECMAScript 2015 (aka es6) with CommonJS modules.
  • @moxy/eslint-config-base/cjs/es2016 - ECMAScript 2016 (aka es7) with CommonJS modules.
  • @moxy/eslint-config-base/cjs/es2017 - ECMAScript 2017 (aka es8) with CommonJS modules.
  • @moxy/eslint-config-base/cjs/es2018 - ECMAScript 2018 (aka es9) with CommonJS modules.
  • @moxy/eslint-config-base/cjs/es2019 - ECMAScript 2019 (aka es10) with CommonJS modules.
  • @moxy/eslint-config-base/cjs/es2020 - ECMAScript 2020 (aka es11) with CommonJS modules.

All files that end in .config.js within your project root folder will automatically be treated as Node.js files as they relate to tooling, such as babel.config.js and commitlint.config.js.

Examples

  • Example of .eslintrc.json for Node.js projects:

      {
          "root": true,
          "env": {
              "node": true
          },
          "extends": [
              "@moxy/eslint-config-base/cjs/es2019"
          ]
      }
  • Example of .eslintrc.json for browser only projects that use ECMAScript modules:

      {
          "root": true,
          "env": {
              "browser": true
          },
          "extends": [
              "@moxy/eslint-config-base/esm",
          ]
      }
  • Example of .eslintrc.json for isomorphic / universal projects that use ECMAScript modules:

      {
          "root": true,
          "env": {
              "browser": true,
              "node": true
          },
          "extends": [
              "@moxy/eslint-config-base/esm"
          ]
      }

ℹ️ Note that by setting root to true, we ensure that no ancestor configuration is used which also improves ESLint performance because no more file lookups need to be done.

Shared functionality

This package contains functionality that may be used directly if necessary:

changelog

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

13.1.0 (2021-07-13)

Features

  • allow noopener in rel when using target blank (#111) (6a26997)

13.0.3 (2020-09-05)

Bug Fixes

  • base: .eslintrc.js files are CJS (edb0796)

13.0.0 (2020-08-07)

⚠ BREAKING CHANGES

  • all packages have now a peerDependency on eslint v7

Features

12.2.0 (2020-06-25)

Note: Version bump only for package @moxy/eslint-config-base

12.1.1 (2020-05-21)

Bug Fixes

  • eslint-config-base: update eslint peer dependency due to modification in no-implicit-gloabls rule (#96) (2f94b83)

12.1.0 (2020-05-04)

Features

  • consider jest.setup.js part of testPattern (2e2c755)

12.0.3 (2020-05-01)

Bug Fixes

  • accept mocks in deep folders (824e014)

12.0.2 (2020-04-24)

Bug Fixes

12.0.1 (2020-04-17)

Bug Fixes

  • add files in mock to test patterns (#94) (0819983)

12.0.0 (2020-03-30)

Features

BREAKING CHANGES

  • added rules that enforce import order

11.0.3 (2020-03-20)

Bug Fixes

  • forgot to disable jest for *.spec.js as part of v11 (8ef54d4)

11.0.2 (2020-03-19)

Bug Fixes

  • fix *.config.js not being correctly set to node (79096cc)

11.0.0 (2020-03-19)

Features

BREAKING CHANGES

  • removed the previous three base packages in favor of just one
  • added a few new rules that were missing

RFC-0003 implementation (2020-03-13)

Bug Fixes

Code Refactoring

BREAKING CHANGES