Install dependencies
$ npm i --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin prettier eslint-config-prettier eslint-plugin-prettier
.eslintrc.js
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
env: {
node: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'prettier/prettier': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
},
ignorePatterns: ['jest.config.js', 'dist/**/*'],
}
.prettierrc.json
{
"semi": false,
"trailingComma": "all",
"singleQuote": true
}