UNPKG

@slhs/eslint-config

Version:
67 lines (48 loc) 1.9 kB
# @slhs/eslint-config This is the SLHS [ESLint](https://eslint.org/) configuration. [![npm Version](https://img.shields.io/npm/v/@slhs/eslint-config.svg?style=for-the-badge)](https://www.npmjs.com/package/@slhs/eslint-config) [![Build Status](https://img.shields.io/badge/CI-GitHub%20Actions-success?logo=github&style=for-the-badge)](https://github.com/slhs/eslint-config/actions?query=workflow%3Aci) ### Requirements This config uses the new "[Flat Config](https://eslint.org/docs/latest/use/configure/configuration-files-new)" format and comes with some requirements: - Node.js 20.0.0 or newer - ESLint 8.57.0 or newer - Your project to be in native ESM (`"type": "module"` in your `package.json`) - VSCode must be configured to use the Flat Config file (`eslint.config.js`). You'll probably want to enable this as a **workspace setting** (not a user setting) and check it in to source control: ![VSCode Settings Screenshot](./other/vscode-flat-config.png) ### Install ``` npm install --save-dev @slhs/eslint-config ``` > Be sure to install the appropriately versioned `eslint` peer dependency as well. ### Usage Follow the ESLint documentation on [shared configurations](https://eslint.org/docs/latest/use/configure/configuration-files#using-a-shareable-configuration-package). See the documentation on [ignoring files](https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files) if you need to ignore anything the config doesn't already ignore by default. ### Examples #### `eslint.config.js` ```js import { defineConfig } from 'eslint/config'; import slhsConfig from '@slhs/eslint-config'; const config = defineConfig([ slhsConfig, { // your optional overrides here }, ]); export default config; ``` #### `package.json` ``` { "scripts": { ... "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint .", ... } } ```