sajad torkamani

Install packages (remove eslint-config-prettier if not using prettier):

npm i -D eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-prettier

Init config file:

npx eslint --init

Edit config file:

module.exports = {
  env: {
    node: true,
  },
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
    'prettier',
  ],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaVersion: 'latest',
    sourceType: 'module',
  },
  plugins: ['@typescript-eslint'],
  rules: {},
}

Add NPM script:

"scripts": { 
  "lint": "eslint . --ext .js,.ts"
}

Run ESLint:

npm run lint