/eslint-config

Strict eslint base config

Primary LanguageJavaScript

ACR eslint config

ACR recommended typescript + prettier + eslint rules based off a strict ruleset, specifically:

Table of Contents

Install

npm install --save-dev @acrontum/eslint-config

Usage

Configure

for eslint versions below 9 (aka legacy):

// eslint.config.js
module.exports = {
  extends: ['@acrontum/eslint-config/legacy']
}

for eslint 9+ (aka why did they do this):

// eslint.config.js or eslint.config.mjs for compat
import { default as acrLint } from '@acrontum/eslint-config';

export default [
  // your rules here
  ...acrLint,
  // or here, if you think you're more special
];

Run

npx eslint -c eslint.config.js 'src/**/*.ts'

Running the new flat config (mjs) mode in a cjs project

For certain older eslint versions, the env flag ESLINT_USE_FLAT_CONFIG=true is required. Try without first, probably.
Also make sure to name it eslint.config.mjs.

ESLINT_USE_FLAT_CONFIG=true npx eslint -c eslint.config.mjs 'src/**/*.ts'