Skip to content

Commit

Permalink
Typescript fixes (#2382)
Browse files Browse the repository at this point in the history
* Add examples (including errors) of typescript issues that need to be fixed

* Issue seems to be the auto generation of imports, removed isolatedFlags error comment

* Fixed npm vulnerability warnings

* Fixed npm vulnerability warnings

* Undo change to table for linting

* Moved new linting rules to be turned off for just old JS files

* Added baseUrl to tsconfig, which fixes TS compiler import error

* Order devDependencies correctly

* Revert "Fixed npm vulnerability warnings"

This reverts commit 1c5e557.

* Removed no-unresolved linting rule for TS/TSX files

* Revert "linting arrow parens"

This reverts commit 1c5e557.

* Removed arrow parens lint rule, and no-unresolved

* Removed unneeded fix from lint script

* Revert arrow parens
  • Loading branch information
NoPhaseNoKill authored and howardchung committed Dec 27, 2019
1 parent 5f212ca commit e7db47f
Show file tree
Hide file tree
Showing 41 changed files with 544 additions and 450 deletions.
40 changes: 38 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ const commonRules = {
]
}
],
"react/sort-comp": [2]
"react/sort-comp": [2],
"react/jsx-fragments": "off",
"react/jsx-curly-newline": "off",
"react/static-property-placement": "off",
"react/jsx-props-no-spreading": "off",
"react/destructuring-assignment": "off",
"react/prop-types": "off",
"react/no-access-state-in-setstate" : "off",
"react/button-has-type": "off",
"max-classes-per-file": 'off',
"import/no-cycle": "off",
}

module.exports = {
Expand All @@ -37,16 +47,39 @@ module.exports = {
},
},
},
"extends": [
"airbnb",
],
"rules": {
...commonRules,
"import/named": ["error"],
"react/state-in-constructor": "off",
"react/destructuring-assignment": "off",
"react/prop-types": "off",
"react/no-access-state-in-setstate" : "off",
"react/button-has-type": "off",
"max-classes-per-file": 'off',
"import/no-cycle": "off",
"arrow-parens": "off",
"operator-linebreak": "off",
"react/jsx-wrap-multilines": "off",
"react/jsx-one-expression-per-line": "off",
"object-curly-newline": "off",
"no-else-return": "off",
"implicit-arrow-linebreak": "off",
"prefer-object-spread": "off",
"lines-between-class-members": "off",
"react/jsx-tag-spacing": "off",
"import/no-useless-path-segments": "off",
"no-dupe-class-members": "off"
},
"overrides": [
{
"files": ["./src/**/*.ts","./src/**/*.tsx"],
"env": { "browser": true, "jest": true},
"extends": [
"airbnb",
"plugin:import/typescript",
"plugin:@typescript-eslint/recommended",
],
"parser": "@typescript-eslint/parser",
Expand All @@ -67,7 +100,10 @@ module.exports = {
"@typescript-eslint/prefer-optional-chain": "error",
"@typescript-eslint/prefer-nullish-coalescing": "error",
'react/jsx-filename-extension': [1, { 'extensions': ['.ts', '.tsx'] }],
"import/prefer-default-export": "off"
"import/prefer-default-export": "off",
"react/state-in-constructor": "off",
"import/extensions": "off",
"import/no-unresolved": "off"
},
}
]
Expand Down
1 change: 0 additions & 1 deletion dev/migrateLangFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@ langs.forEach((langFile) => {

fs.writeFileSync(path.resolve(langsPath, langFile), JSON.stringify(updatedLang, undefined, ' '));
});

1 change: 0 additions & 1 deletion dev/updatelangvpk.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,3 @@ request('https://github.com/raw/dotabuff/d2vpkr/master/dota/scripts/r
Object.keys(langTagNames).forEach(tag => updateLang(tag, langTagNames[tag]));
});
});

62 changes: 30 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@
"devDependencies": {
"@storybook/addon-actions": "^5.2.8",
"@storybook/react": "^5.2.8",
"@types/jest": "^24.0.24",
"@types/node": "^12.12.20",
"@types/react": "^16.9.16",
"@types/react-dom": "^16.9.4",
"@types/core-js": "^2.5.2",
"@types/eslint": "^6.1.3",
"@types/heatmap.js": "^2.0.36",
"@types/history": "^4.7.3",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/isomorphic-fetch": "^0.0.35",
"@types/jest": "^24.0.24",
"@types/lodash": "^4.14.149",
"@types/long": "^4.0.0",
"@types/material-ui": "^0.20.8",
"@types/nanoid": "^2.1.0",
"@types/node": "^12.12.20",
"@types/papaparse": "^5.0.3",
"@types/prop-types": "^15.7.3",
"@types/react": "^16.9.16",
"@types/react-content-loader": "^3.1.4",
"@types/react-dom": "^16.9.4",
"@types/react-helmet": "^5.0.11",
"@types/react-redux": "^7.1.4",
"@types/react-router-dom": "^4.3.5",
Expand All @@ -105,12 +105,12 @@
"babel-preset-es2015": "^6.24.1",
"cross-env": "^6.0.3",
"eslint": "^6.6.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-config-airbnb": "^18.0.1",
"eslint-plugin-import": "^2.19.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-react": "^7.7.0",
"husky": "^3.1.0",
"hoist-non-react-statics": "^3.3.1",
"husky": "^3.1.0",
"isomorphic-fetch": "^2.2.1",
"sanitize-filename": "^1.6.3",
"simple-vdf": "^1.1.1",
Expand Down
1 change: 1 addition & 0 deletions src/components/Announce/index.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line no-redeclare
/* global localStorage */
import React from 'react';
import PropTypes from 'prop-types';
Expand Down
Loading

0 comments on commit e7db47f

Please sign in to comment.