Last active
April 5, 2021 21:33
-
-
Save MohammedALREAI/cdff1efd79e7e9febb9cd75b80eee6cb to your computer and use it in GitHub Desktop.
setup the eslint
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// .eslint.js=> | |
module.exports = { | |
parser: '@typescript-eslint/parser', | |
overrides: [ | |
{ | |
files: ['*.ts', '*.tsx'], // Your TypeScript files extension | |
parserOptions: { | |
project: ['./tsconfig.json'], // Specify it only for TypeScript files | |
}, | |
} | |
], | |
plugins: ['@typescript-eslint/eslint-plugin'], | |
extends: [ | |
'plugin:@typescript-eslint/eslint-recommended', | |
'plugin:@typescript-eslint/recommended', | |
'prettier', | |
], | |
root: true, | |
env: { | |
node: true, | |
}, | |
rules: { | |
'@typescript-eslint/no-var-requires': 0, | |
'@typescript-eslint/interface-name-prefix': 'off', | |
'@typescript-eslint/explicit-function-return-type': 'off', | |
'@typescript-eslint/no-explicit-any': 'off', | |
'@typescript-eslint/explicit-module-boundary-types': 'off', | |
'@typescript-eslint/no-unused-vars': 'off', | |
'@typescript-eslint/ban-types': 'off', | |
}, | |
}; | |
// package.json | |
=> | |
// "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", | |
// "lint": "eslint \"src/**/*.ts\" --fix", | |
// "husky": { | |
// "hooks": { | |
// "pre-commit": "lint-staged", | |
// "pre-push": "yarn lint", | |
// "post-rebase": "yarn install" | |
// } | |
// }, | |
// "lint-staged": { | |
// "*.{js,ts,tsx}": [ | |
// "eslint --fix" | |
// ] | |
// } | |
// package => | |
// prettier tslint-config-prettier tslint-plugin-prettier husky lint-staged eslint eslint-config-prettier | |
// eslint-plugin-import @typescript-eslint/eslint-plugin typescript-eslint/parser | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment