Skip to main content

eslint()

API > @betterer/eslint > eslint

Use this test to incrementally introduce new ESLint rules to your codebase. You can pass as many ESLint rule configurations as you like:

Signature

export declare function eslint(rules: BettererESLintRulesConfig): BettererFileTest;

Parameters

ParameterTypeDescription
rulesBettererESLintRulesConfigAdditional ESLint rules to enable.

Returns

BettererFileTest

Exceptions

BettererError Will throw if the user doesn't pass rules.

Remarks

eslint is a BettererFileTest, so you can use include(), exclude(), only(), and skip().

Example

import { eslint } from '@betterer/eslint';

export default {
'new eslint rules': () =>
eslint({
'no-debugger': 'error',
'no-unsafe-finally': 'error',
})
.include('./src/*.ts')
};