LMC’s ESLint config for projects using Jest as test runner
These configuration files are suitable to lint Jest test files.
npm install @lmc-eu/eslint-config-jest -D
or
yarn add @lmc-eu/eslint-config-jest -D
Create a .eslintrc.js file with the following contents:
module.exports = {
extends: [
// ... (base eslint config)
'@lmc-eu/eslint-config-jest',
],
};
The shareable config can be customized in your eslint configuration file.
Use this ruleset to configure ESLint to lint your Jest test files. Jest test files are by default identified by *.test.*
or *.spec.*
filenames or by being in the test/ directory in your project root or by using __test__/
directories near your tested files.
⚠️ You can use this environment ruleset in combination with any of the existing environment rulesets. Just make sure this one comes in as the last one.
This configuration uses the following plugins:
For available rules see ESLint plugin Jest and ESLint plugin Jest Formatting
See the LICENSE file for information.