ESLint Config Tester
eslint-config-tester
is a utility library to write tests for ESLint configurations. It relies on
eslint.CLIEngine
to run configurations.
Installation
Install ESLint locally.
$ yarn add eslint --dev
Install the ESlint Config Tester locally.
$ yarn add eslint-config-tester --dev
Usage
eslint-config-tester
exposes a single runOnText
method. This method lets you run any given configuration
against a JavaScript snippet. It throws an error if the configuration has any problems or the JavaScript snippet
violates the rules set by the configuration.
'use strict'; const eslintConfigTester = ;const path = ; const pathToEslintConfig = path;const jsSnippetToTest = "const hello = 'world';\nexport default hello;\n"; eslintConfigTester; eslintConfigTester;
Contributing
See Contributing.