---
# System prepended metadata

title: Config

---

# Config

Add Eslint

```bash=
npm i -D eslint
eslint --init
node_modules/.bin/eslint --init
```



Add ESLint With TypeScript Support

``` :=javascript
npm install --save-dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin
```

Create ``.eslintrc.js``

```
//.eslintrc.js

module.exports = {
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/eslint-recommended',
    'plugin:@typescript-eslint/recommended',
  ],
  env: {
    node: true,
  },
  parser: '@typescript-eslint/parser',
  plugins: ['@typescript-eslint'],
  settings: {
    'import/parsers': {
      '@typescript-eslint/parser': ['.ts', '.tsx'],
    },
    'import/resolver': {
      typescript: {},
    },
  },
  parserOptions: {
    project: './tsconfig.json',
    tsconfigRootDir: './',
    sourceType: 'module',
    ecmaVersion: 2019,
  },
  rules: {
    '@typescript-eslint/no-explicit-any': 'off',
  },
};
```

Create ``.eslintignore``

```
node_modules
.serverless
.vscode
*.config.js
.webpack
**/*.js
```

Add prettier 
``npm install --save-dev prettier eslint-config-prettier eslint-plugin-prettier``

Create ``.prettierrc.js``

```
module.exports = {
  printWidth: 120,
  singleQuote: true,
  trailingComma: 'all',
};
```

Create ``.pretierignore``

```
node_modules
.serverless
.webpack
```

Update ``webpack.config.js``

```
plugins: [
  new ForkTsCheckerWebpackPlugin({
    eslint: true,
    eslintOptions: {
      cache: true,
    },
  }),
],
```
