babel/eslint/babel-eslint-plugin-development-internal
Huáng Jùnliàng 3fad7eab9b
Use Yarn 2 (#11962)
* chore: use yarn 2

* chore: remove redundant yarn locks

* chore: remove publishEslintPkg

* chore: remove redundant make bootstrap

* Update .yarnrc.yml

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>

* chore: use workspace protocol for eslint packages in the root

Co-Authored-By: merceyz <merceyz@users.noreply.github.com>

* chore: pin caniuse-lite versions

Testcases in packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie
depends on specific caniuse-lite versions. We pinned the version here
so we don't have to deal with fixture different in e2e-tests
where all deps will be updated and tested.

* chore: resolve yarn install warnings

* chore: update yarn cache path on circle/travis

* chore: add yarn deduplicate plugin

* chore: deduplicate lock files

* chore: move devDependencies to leaf packages

* chore: remove @yarnpkg/plugin-constraints

* chore: remove unused dedupe options

* test: fix unwanted self reference

* chore: remove output-file-sync dependency

* chore: update browserify to 16.5.2

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
2020-08-25 14:37:30 -04:00
..
2020-08-08 15:59:38 -04:00

@babel/eslint-plugin-development-internal

The Babel team's custom ESLint rules for the babel/babel monorepo.

Installation

$ npm install --save-dev @babel/eslint-plugin-development-internal

or

$ yarn add --save-dev @babel/eslint-plugin-development-internal

Usage

The plugin can be loaded in your .eslintrc.* configuration file as follows: (note that you can omit the eslint-plugin- prefix):

{
  "plugins": ["@babel/development-internal"]
}

Rules

@babel/development-internal/dry-error-messages

Intended for use in packages/babel-parser/src/**/*. When enabled, this rule warns when this.raise() invocations raise errors that are not imported from a designated error module.

Accepts an object configuration option:

{
  errorModule: string
}

errorModule (required): The rule expects either an absolute path or a module name (for a module in node_modules). Please note that the rule will not check anything if errorModule is not given.

Example configuration:

{
  rules: {
    "@babel/development-internal/dry-error-messages": [
      "error",
      {
        errorModule: "@babel/shared-error-messages"
      }
    ]
  }
}

and

{
  rules: {
    "@babel/development-internal/dry-error-messages": [
      "error",
      {
        errorModule: path.resolve(
          __dirname,
          "packages/shared-error-messages/lib/index.js"
        )
      }
    ]
  }
}