fix(tests): correctly extend eslint config

This commit is contained in:
Łukasz Mierzwa
2020-09-08 16:33:23 +01:00
committed by Łukasz Mierzwa
parent 6733676bb2
commit cce3582057
9 changed files with 66 additions and 44 deletions
+2 -2
View File
@@ -53,14 +53,14 @@ func TestCustomizationAssets(t *testing.T) {
customJS: "../../ui/.env",
path: "/custom.js",
code: 200,
body: "PUBLIC_URL=.\n",
body: "PUBLIC_URL=.\nEXTEND_ESLINT=true\n",
mime: "text/plain; charset=utf-8",
},
{
customCSS: "../../ui/.env",
path: "/custom.css",
code: 200,
body: "PUBLIC_URL=.\n",
body: "PUBLIC_URL=.\nEXTEND_ESLINT=true\n",
mime: "text/plain; charset=utf-8",
},
}
+1
View File
@@ -7,6 +7,7 @@ ignores:
- typeface-open-sans
# devDeps
- "@types/jest"
- "@types/node"
- "@commitlint/travis-cli"
- "@storybook/preset-create-react-app"
- depcheck
+1
View File
@@ -1 +1,2 @@
PUBLIC_URL=.
EXTEND_ESLINT=true
+15 -4
View File
@@ -1,13 +1,24 @@
root: true
parser: "@typescript-eslint/parser"
plugins:
- "@typescript-eslint"
- "prettier"
extends:
- react-app
- plugin:react/recommended
- plugin:@typescript-eslint/recommended
- prettier/@typescript-eslint
- plugin:prettier/recommended
- "plugin:@typescript-eslint/recommended"
- "prettier/@typescript-eslint"
- "plugin:prettier/recommended"
settings:
react:
version: detect
rules:
"react/prop-types": off
"react/display-name": off
"@typescript-eslint/no-empty-function": off
# noisy
"@typescript-eslint/explicit-function-return-type": off
# # https://github.com/typescript-eslint/typescript-eslint/issues/2502
"@typescript-eslint/no-use-before-define": off
overrides:
- files:
- "**/__mocks__/*.ts"
+2
View File
@@ -8,6 +8,7 @@ node_modules/%: package.json package-lock.json
touch -c $@
build/index.html: node_modules/react-scripts/bin/react-scripts.js $(call rwildcard, public src, *)
@rm -fr node_modules/.cache/eslint-loader
npm run build
.PHONY: build
@@ -27,6 +28,7 @@ test-percy: node_modules/@storybook/react/bin/build.js
.PHONY: lint-js
lint-js: node_modules/eslint/bin/eslint.js
@rm -fr node_modules/.cache/eslint-loader
node_modules/eslint/bin/eslint.js --ext .js,.jsx,.ts,.tsx src
.PHONY: lint-git-ci
+36 -30
View File
@@ -4045,6 +4045,13 @@
"regexpp": "^3.0.0",
"semver": "^7.3.2",
"tsutils": "^3.17.1"
},
"dependencies": {
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ=="
}
}
},
"@typescript-eslint/experimental-utils": {
@@ -4181,6 +4188,11 @@
"is-extglob": "^2.1.1"
}
},
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ=="
},
"slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
@@ -4447,9 +4459,9 @@
}
},
"acorn-jsx": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz",
"integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ=="
"version": "5.3.1",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz",
"integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng=="
},
"acorn-walk": {
"version": "6.2.0",
@@ -6252,12 +6264,12 @@
}
},
"browserslist": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.0.tgz",
"integrity": "sha512-pUsXKAF2lVwhmtpeA3LJrZ76jXuusrNyhduuQs7CDFf9foT4Y38aQOserd2lMe5DSSrjf3fx34oHwryuvxAUgQ==",
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.1.tgz",
"integrity": "sha512-zyBTIHydW37pnb63c7fHFXUG6EcqWOqoMdDx6cdyaDFriZ20EoVxcE95S54N+heRqY8m8IUgB5zYta/gCwSaaA==",
"requires": {
"caniuse-lite": "^1.0.30001111",
"electron-to-chromium": "^1.3.523",
"caniuse-lite": "^1.0.30001124",
"electron-to-chromium": "^1.3.562",
"escalade": "^3.0.2",
"node-releases": "^1.1.60"
}
@@ -8342,9 +8354,9 @@
}
},
"dot-prop": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz",
"integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==",
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz",
"integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==",
"requires": {
"is-obj": "^2.0.0"
}
@@ -8414,9 +8426,9 @@
}
},
"electron-to-chromium": {
"version": "1.3.562",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.562.tgz",
"integrity": "sha512-WhRe6liQ2q/w1MZc8mD8INkenHivuHdrr4r5EQHNomy3NJux+incP6M6lDMd0paShP3MD0WGe5R1TWmEClf+Bg=="
"version": "1.3.564",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.564.tgz",
"integrity": "sha512-fNaYN3EtKQWLQsrKXui8mzcryJXuA0LbCLoizeX6oayG2emBaS5MauKjCPAvc29NEY4FpLHIUWiP+Y0Bfrs5dg=="
},
"element-resize-detector": {
"version": "1.2.1",
@@ -14683,9 +14695,9 @@
}
},
"node-fetch": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
},
"node-forge": {
"version": "0.9.0",
@@ -16663,8 +16675,7 @@
"prettier": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz",
"integrity": "sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==",
"dev": true
"integrity": "sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw=="
},
"prettier-linter-helpers": {
"version": "1.0.0",
@@ -18976,9 +18987,9 @@
}
},
"rxjs": {
"version": "6.6.2",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.2.tgz",
"integrity": "sha512-BHdBMVoWC2sL26w//BCu3YzKT4s2jip/WhwsGEDmeKYBhKDZeYezVUnHatYB7L85v5xs0BAQmg6BEYJEKxBabg==",
"version": "6.6.3",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz",
"integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==",
"requires": {
"tslib": "^1.9.0"
}
@@ -19193,11 +19204,6 @@
"node-forge": "0.9.0"
}
},
"semver": {
"version": "7.3.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz",
"integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ=="
},
"semver-compare": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz",
@@ -22200,9 +22206,9 @@
}
},
"whatwg-fetch": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.4.0.tgz",
"integrity": "sha512-rsum2ulz2iuZH08mJkT0Yi6JnKhwdw4oeyMjokgxd+mmqYSd9cPpOQf01TIWgjxG/U4+QR+AwKq6lSbXVxkyoQ=="
"version": "3.4.1",
"resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.4.1.tgz",
"integrity": "sha512-sofZVzE1wKwO+EYPbWfiwzaKovWiZXf4coEzjGP9b2GBVgQRLQUZ2QcuPpQExGDAW5GItpEm6Tl4OU5mywnAoQ=="
},
"whatwg-mimetype": {
"version": "2.3.0",
+2 -1
View File
@@ -22,6 +22,7 @@
"@types/lodash.merge": "4.6.6",
"@types/lodash.throttle": "4.1.6",
"@types/lodash.uniqueid": "4.0.6",
"@types/node": "14.6.4",
"@types/promise-retry": "1.1.3",
"@types/qs": "6.9.4",
"@types/react": "16.9.49",
@@ -53,6 +54,7 @@
"mobx-react-lite": "2.2.1",
"mobx-stored": "1.1.0",
"node-sass": "4.14.1",
"prettier": "2.1.1",
"promise-retry": "2.0.1",
"qs": "6.9.4",
"react": "16.13.1",
@@ -89,7 +91,6 @@
"jest-canvas-mock": "2.2.0",
"jest-date-mock": "1.0.8",
"markdownlint-cli": "0.23.2",
"prettier": "2.1.1",
"puppeteer": "5.2.1",
"source-map-explorer": "2.5.0"
},
@@ -157,7 +157,7 @@ const HistoryMenu: FC<{
);
};
interface historyStorageT {
interface HistoryStorageT {
filters: ReduceFilterT[][];
}
@@ -166,7 +166,7 @@ const History: FC<{
settingsStore: Settings;
}> = ({ alertStore, settingsStore }) => {
// this will be dumped to local storage via mobx-stored
const history: historyStorageT = localStored(
const history: HistoryStorageT = localStored(
"history.filters",
{
filters: [],
+5 -5
View File
@@ -46,14 +46,14 @@ const ReactSelectColors: ReactSelectThemes = {
},
};
interface stateFnT {
interface StateFnT {
isFocused: boolean;
isMulti: boolean;
isDisabled: boolean;
}
const ReactSelectStyles = (theme: ReactSelectTheme): Styles => ({
control: (base: CSSProperties, state: stateFnT) =>
control: (base: CSSProperties, state: StateFnT) =>
state.isFocused
? {
...base,
@@ -74,7 +74,7 @@ const ReactSelectStyles = (theme: ReactSelectTheme): Styles => ({
borderColor: theme.borderColor,
"&:hover": { borderColor: theme.borderColor },
},
valueContainer: (base: CSSProperties, state: stateFnT) =>
valueContainer: (base: CSSProperties, state: StateFnT) =>
state.isMulti
? {
...base,
@@ -138,7 +138,7 @@ const ReactSelectStyles = (theme: ReactSelectTheme): Styles => ({
...base,
color: "inherit",
}),
indicatorsContainer: (base: CSSProperties, state: stateFnT) => ({
indicatorsContainer: (base: CSSProperties, state: StateFnT) => ({
...base,
backgroundColor: state.isDisabled
? theme.disabledValueContainerBackground
@@ -146,7 +146,7 @@ const ReactSelectStyles = (theme: ReactSelectTheme): Styles => ({
borderTopRightRadius: "0.25rem",
borderBottomRightRadius: "0.25rem",
}),
dropdownIndicator: (base: CSSProperties, state: stateFnT) =>
dropdownIndicator: (base: CSSProperties, state: StateFnT) =>
state.isFocused
? {
...base,