I’m working on a project where I use react using typescript. And also I use prettier, and the typescript-eslint. Though it is working with the normal command eslint ...
but the sublime doesn’t show any errors or warnings. I’m not sure if I’m using the correct sublime extension package.
I installed SublimeLinter
and SublimeLinter-eslint
. There’s also a Typescript
package installed but I’m not sure if that’s related.
Here’s my .eslintrc
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": [
"@typescript-eslint",
"prettier",
"react"
],
"extends":[
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:prettier/recommended",
"prettier",
"prettier/@typescript-eslint",
"prettier/react"
],
"rules": {
"prettier/prettier": "error"
},
"settings": {
"react": {
"version": "detect"
}
},
"env": {
"browser": true
}
}
and my package.json
{
"scripts": {
"start:dev": "webpack-dev-server --config webpack.config.dev.js",
"lint": "eslint './src/**/*.{ts,tsx}'"
},
"dependencies": {
"@material-ui/core": "^4.2.1",
"@material-ui/icons": "^4.2.1",
"clsx": "^1.0.4",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-redux": "^7.1.0",
"react-router-dom": "^5.0.1",
"redux": "^4.0.4"
},
"devDependencies": {
"@types/material-ui": "^0.21.6",
"@types/react": "^16.8.23",
"@types/react-dom": "^16.8.5",
"@types/react-redux": "^7.1.1",
"@types/react-router-dom": "^4.3.4",
"@typescript-eslint/eslint-plugin": "^1.13.0",
"@typescript-eslint/parser": "^1.13.0",
"clean-webpack-plugin": "^3.0.0",
"eslint": "^6.1.0",
"eslint-config-prettier": "^6.0.0",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3",
"html-webpack-plugin": "^3.2.0",
"husky": "^3.0.1",
"lint-staged": "^9.2.1",
"prettier": "^1.18.2",
"source-map-loader": "^0.2.4",
"ts-loader": "^6.0.4",
"typescript": "^3.5.3",
"webpack": "^4.37.0",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.3.6",
"webpack-dev-server": "^3.7.2"
},
"lint-staged": {
"linters": {
"*.{ts,tsx}": [
"prettier --write",
"eslint --ignore-path .prettierignore --fix",
"git add"
]
}
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}
I tried it on vscode it works. The problem is that vscode is very slow on my machine.