Apteryx's ESLint Config
Installation
npm install eslint eslint-config-apteryx
yarn add eslint eslint-config-apteryx
pnpm add eslint eslint-config-apteryx
Any additional dependencies - based on which configurations you decide to use - will automatically be installed upon your first run of ESLint.
Usage
This package includes the following configurations:
apteryx/common
-
apteryx/browser
– for usage with DOM and other browser APIs. -
apteryx/jsx
– for usage with JSX (with or without React). -
apteryx/module
– for usage with ESM modules. -
apteryx/next
– for usage with Next.js. -
apteryx/node
- for usage with Node.js. -
apteryx/prettier
- for usage with Prettier. -
apteryx/react
- for usage with React. -
apteryx/typescript
- for usage with TypeScript.
Configuration
Node.js
{
"root": true,
"extends": [
"apteryx/common",
"apteryx/node",
"apteryx/typescript",
"apteryx/prettier"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"ignorePatterns": ["**/dist/*"]
}
React / Next
{
"root": true,
"extends": [
"apteryx/common",
"apteryx/browser",
"apteryx/node",
"apteryx/typescript",
"apteryx/next",
"apteryx/prettier"
],
"parserOptions": {
"project": "./tsconfig.json"
},
"ignorePatterns": ["**/dist/*"],
"rules": {
"react/react-in-jsx-scope": 0,
"react/jsx-filename-extension": [1, { "extensions": [".tsx"] }]
}
}
Usage with Prettier
Use with prettier-config-apteryx.
{
"extends": [
"apteryx/common",
"apteryx/node",
"apteryx/typescript",
"apteryx/prettier"
]
}
apteryx/prettier
must be last in the list, as this will disable all other rules that conflict with Prettier.