Enhances Airbnb's ESLint config with TypeScript support
npm i eslint \
@lemonbot.fun/eslint-config-node \
@typescript-eslint/eslint-plugin@^7.0.0 \
@typescript-eslint/parser@^5.0.0 \
typescript \
-D
#eg: pnpm
pnpm add eslint \
@lemonbot.fun/eslint-config-node \
@typescript-eslint/eslint-plugin@^7.0.0 \
@typescript-eslint/parser@^5.0.0 \
typescript \
-D
#eg: yarn
yarn add eslint \
@lemonbot.fun/eslint-config-node \
@typescript-eslint/eslint-plugin@^7.0.0 \
@typescript-eslint/parser@^5.0.0 \
typescript \
--dev
Within your ESLint config file:
extends: [
require.resolve('@lemonbot.fun/eslint-config-node/index'),
]
This config requires knowledge of your TypeScript config.
In your ESLint config, set
parserOptions.project
to the path of your tsconfig.eslint.json
.
For example:
{
extends: [
'@lemonbot.fun/eslint-config-node'
],
+ parserOptions: {
+ project: './tsconfig.eslint.json'
+ }
}
Open a terminal to the root of your project, and run the following command:
npx eslint . --ext .js,.jsx,.ts,.tsx
ESLint will lint all .js, .jsx, .ts, and .tsx files within the current folder, and output results to your terminal.
You can also get results in realtime inside most IDEs via a plugin.
Authored and maintained by Jason Chang (Lemonbot).
Open source licensed as MIT.