3.2.1 • Published 9 days ago

@ericcornelissen/eslint-plugin-top v3.2.1

Weekly downloads
-
License
ISC
Repository
github
Last release
9 days ago

eslint-plugin-top

Disallow side effects at the top level of files.

Installation

First, If you haven't already, install ESLint:

npm install eslint --save-dev

Then, install eslint-plugin-top:

npm install @ericcornelissen/eslint-plugin-top --save-dev

Usage

New Config (since ESLint v9)

Import from @ericcornelissen/eslint-plugin-top and use it as a plugin. Then configure the rules you want to use in the rules section:

import top from '@ericcornelissen/eslint-plugin-top';

export default [
  {
    plugins: {top},
    rules: {
      'top/no-top-level-side-effects': 'error',
      'top/no-top-level-variables': 'error'
    }
  }
];

Note that the rule prefix (top in the example) must match the name of the key used in the plugins object.

Legacy Config (before ESLint v9)

First, add @ericcornelissen/top to the plugins section of your .eslintrc configuration file. You must omit the eslint-plugin- infix:

plugins:
  - '@ericcornelissen/top'

Then, configure the rules you want to use in the rules section:

rules:
  '@ericcornelissen/top/no-top-level-side-effects': error
  '@ericcornelissen/top/no-top-level-variables': error

Supported Rules


Please open an issue if you found a mistake or if you have a suggestion for how to improve the documentation.

3.2.1

9 days ago

3.2.0

27 days ago

2.3.2

1 month ago

3.1.0

4 months ago

3.0.0

4 months ago

2.3.0

5 months ago

2.2.1

5 months ago

2.2.0

5 months ago

2.3.1

5 months ago

2.2.2

5 months ago

2.1.0

9 months ago

1.0.1

1 year ago

1.0.0

1 year ago

2.0.0

11 months ago

0.3.0

1 year ago

0.2.1

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.0

1 year ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago