Skip to content

Commit

Permalink
Switched from tslint to eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
nicedexter committed Sep 6, 2019
1 parent 3871906 commit 75d97bb
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 222 deletions.
26 changes: 26 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
extends: [
'eslint:recommended',
'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
'prettier/@typescript-eslint',
'plugin:prettier/recommended' // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports,
ecmaFeatures: {
jsx: true // Allows for the parsing of JSX
}
},
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
},
settings: {
react: {
version: 'detect' // Tells eslint-plugin-react to automatically detect the version of React to use
}
}
};
3 changes: 3 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
singleQuote: true,
};
20 changes: 18 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
{
"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"files.trimTrailingWhitespace": true,
"files.trimFinalNewlines": true,
"[javascript]": {
"editor.formatOnSave": false
},
"[javascriptreact]": {
"editor.formatOnSave": false
},
"[typescript]": {
"editor.formatOnSave": false
},
"[typescriptreact]": {
"editor.formatOnSave": false
},
"eslint.validate": [
"javascript",
"javascriptreact",
{ "language": "typescript", "autoFix": true },
{ "language": "typescriptreact", "autoFix": true }
],
"breadcrumbs.enabled": true,
"workbench.editor.highlightModifiedTabs": true
}
14 changes: 10 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"watch": "react-scripts start",
"build": "react-scripts --max_old_space_size=5048 build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"lint:fix": "eslint './src/**/*.{ts,tsx}'"
},
"devDependencies": {
"@types/d3": "^5.7.2",
Expand All @@ -62,15 +63,20 @@
"@types/string-hash": "^1.1.1",
"@types/styled-components": "^4.1.18",
"@types/vis": "^4.21.19",
"@typescript-eslint/eslint-plugin": "^2.1.0",
"@typescript-eslint/parser": "^2.1.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"eslint": "^6.3.0",
"eslint-config-prettier": "^6.2.0",
"eslint-config-react": "^1.1.7",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.14.3",
"jest-canvas-mock": "^2.1.1",
"prettier-tslint": "^0.4.2",
"prettier": "^1.18.2",
"react-scripts": "^3.1.1",
"react-test-renderer": "^16.9.0",
"source-map-explorer": "^2.0.1",
"tslint-config-prettier": "^1.18.0",
"tslint-react": "^4.0.0",
"typescript": "^3.6.2"
},
"jest": {},
Expand Down
25 changes: 0 additions & 25 deletions tsconfig.json

This file was deleted.

18 changes: 0 additions & 18 deletions tslint.json

This file was deleted.

Loading

0 comments on commit 75d97bb

Please sign in to comment.