An opinionated ESLint ruleset targeting TypeScript + React web apps
- ESLint
^8.48.0
-
Install
eslintand@getresponse/eslint-config:npm i -D eslint @getresponse/eslint-config
-
Add
"extends": "@getresponse/eslint-config"to your ESLint configuration file
Since @typescript-eslint v8, all linted .ts/.tsx files must be included in your tsconfig.json. Files outside the project will cause an error when type-aware rules are active. Make sure your tsconfig.json (or a dedicated tsconfig.eslint.json) covers all files you want to lint:
{
"include": ["src/**/*", "tests/**/*"]
}Rules for the following tools are enabled automatically when the corresponding package is detected in your package.json:
typescriptreactjest@playwright/test/playwright
Additional opt-in rulesets are available:
// .eslintrc.js
module.exports = {
extends: [
'@getresponse/eslint-config',
'@getresponse/eslint-config/mixins/a11y',
],
};| Mixin | Description |
|---|---|
@getresponse/eslint-config/mixins/a11y |
Accessibility rules via eslint-plugin-jsx-a11y |
The web version of the rules list is available on GitHub Pages