Skip to content

Commit

Permalink
chore(deps): update lint deps and use implicit configuration (#751)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored Feb 1, 2022
1 parent eb44b57 commit 0fe68af
Show file tree
Hide file tree
Showing 21 changed files with 1,674 additions and 2,070 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
'use strict';

module.exports = {
root: true,
// Start with google standard style and disable the prettier-controlled rules
// https://github.com/google/eslint-config-google/blob/master/index.js
extends: [
Expand All @@ -17,6 +18,7 @@ module.exports = {
],
// Use the prettier plugin to enforce prettier violations
plugins: ['prettier', 'import'],
ignorePatterns: ['dist/'],
env: {
node: true,
es6: true,
Expand Down Expand Up @@ -65,8 +67,9 @@ module.exports = {
'valid-jsdoc': 0,
'arrow-parens': 0,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
ecmaVersion: 2020,
ecmaFeatures: {
globalReturn: true,
jsx: false,
Expand Down
4 changes: 4 additions & 0 deletions .eslintrc.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

module.exports = {
extends: ['./.eslintrc.js'],
plugins: ['jest'],
env: {
'jest/globals': true,
},
rules: {
'import/no-extraneous-dependencies': 'off',
},
Expand Down
4 changes: 2 additions & 2 deletions .eslintrc.ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ module.exports = {
varsIgnorePattern: '(^_$|^h$)',
},
],
strict: 'off',
},
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2019,
ecmaVersion: 2020,
ecmaFeatures: {
jsx: true,
},
Expand Down
12 changes: 9 additions & 3 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@
'use strict';

module.exports = {
preset: 'ts-jest/presets/js-with-ts-esm',
globals: {
'ts-jest': {
// Disable typechecking.
diagnostics: false,
isolatedModules: true,
},
},
testEnvironment: 'node',
testRunner: require.resolve('jest-circus/runner'),
globalSetup: require.resolve('./packages/server/test/storybook-setup.js'),
globalTeardown: require.resolve('./packages/server/test/storybook-teardown.js'),
transform: {
'.*jsx$': 'babel-jest',
},
moduleNameMapper: {
'\\.css$': 'identity-obj-proxy',
'\\.(svg|png|jpg|jpeg)$': '<rootDir>/packages/server/test/__mocks__/file-mock.js',
Expand Down
28 changes: 13 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@
"test:quick": "npm run test:typecheck && npm run test:lint && npm run test:unit -- --testPathIgnorePatterns=\"cli.test.js\"",
"test:typecheck": "tsc -p .",
"test:lint": "npm run test:lint:js && npm run test:lint:jsx && npm run test:lint:tests",
"test:lint:fix": "npm run test:lint:js --fix && npm run test:lint:jsx --fix && npm run test:lint:tests --fix",
"test:lint:js": "eslint ./packages/*/src",
"test:lint:jsx": "eslint -c ./.eslintrc.ui.js --ext jsx ./packages/server/src/ui ./packages/viewer/src/ui",
"test:lint:tests": "eslint -c ./.eslintrc.tests.js ./packages/*/test",
"test:lint:jsx": "eslint ./packages/server/src/ui ./packages/viewer/src/ui",
"test:lint:tests": "eslint ./packages/*/test",
"test:docker": "bash scripts/test-docker.sh",
"test:unit": "jest --maxWorkers=2"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/plugin-transform-react-jsx": "^7.10.1",
"@babel/preset-env": "^7.10.1",
"@chialab/esbuild-plugin-html": "^0.12.2",
"@storybook/addon-actions": "^6.4.13",
"@storybook/addon-links": "^6.4.13",
Expand Down Expand Up @@ -58,20 +56,19 @@
"@types/uuid": "^8.3.0",
"@types/yargs": "^12.0.8",
"@types/yargs-parser": "^11.0.0",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.0.1",
"babel-loader": "^8.1.0",
"@typescript-eslint/parser": "^5.10.2",
"esbuild": "^0.14.11",
"eslint": "^7.1.0",
"eslint": "^8.8.0",
"eslint-config-google": "^0.14.0",
"eslint-config-prettier": "^6.11.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react": "^1.1.7",
"eslint-plugin-import": "^2.20.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jest": "^26.0.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"identity-obj-proxy": "^3.0.0",
"jest": "^25.0.0",
"jest-circus": "^25.0.0",
"jest": "^27.4.7",
"jest-circus": "^27.4.6",
"jest-fetch-mock": "^3.0.3",
"jest-image-snapshot": "^4.5.1",
"lerna": "^3.22.0",
Expand All @@ -84,6 +81,7 @@
"puppeteer": "^13.1.2",
"rimraf": "^3.0.2",
"sqlite3": "^5.0.0",
"ts-jest": "^27.1.3",
"typescript": "^4.5.4"
}
}
5 changes: 2 additions & 3 deletions babel.config.js → packages/cli/test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/**
* @license Copyright 2019 Google Inc. All Rights Reserved.
* @license Copyright 2022 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';

module.exports = {
presets: ['@babel/preset-env'],
plugins: [['@babel/plugin-transform-react-jsx', {pragma: 'h'}]],
extends: ['../../../.eslintrc.tests.js'],
};
1 change: 0 additions & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"uuid": "^8.3.1"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"clsx": "^1.0.4",
"d3": "^5.15.0",
"plotly.js": "^1.48.3",
Expand Down
10 changes: 10 additions & 0 deletions packages/server/src/ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @license Copyright 2022 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';

module.exports = {
extends: ['../../../../.eslintrc.ui.js'],
};
10 changes: 10 additions & 0 deletions packages/server/test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @license Copyright 2022 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';

module.exports = {
extends: ['../../../.eslintrc.tests.js'],
};
10 changes: 10 additions & 0 deletions packages/server/test/ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @license Copyright 2022 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';

module.exports = {
extends: ['../../../../.eslintrc.tests.js', '../../../../.eslintrc.ui.js'],
};
4 changes: 4 additions & 0 deletions packages/server/test/ui/components/async-loader.test.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/** @jest-environment jsdom */

/**
* @license Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

/* eslint-env jest */

import {h} from 'preact';
import {
AsyncLoader,
Expand Down
4 changes: 4 additions & 0 deletions packages/server/test/ui/routes/build-view/build-view.test.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/** @jest-environment jsdom */

/**
* @license Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

/* eslint-env jest */

import {h} from 'preact';
import {api} from '../../../../src/ui/hooks/use-api-data.jsx';
import {BuildView} from '../../../../src/ui/routes/build-view/build-view.jsx';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/** @jest-environment jsdom */

/**
* @license Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

/* eslint-env jest */

import {h} from 'preact';
import {computeAuditGroups} from '../../../../src/ui/routes/build-view/lhr-comparison.jsx';
import {cleanup} from '../../../test-utils.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/** @jest-environment jsdom */

/**
* @license Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

/* eslint-env jest */

import {h} from 'preact';
import {buildMinMaxByBuildId} from '../../../../../../src/ui/routes/project-dashboard/graphs/category-score/score-line-graph';
import {cleanup} from '../../../../../test-utils.js';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/** @jest-environment jsdom */

/**
* @license Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/

/* eslint-env jest */

import {h} from 'preact';
import {api} from '../../../../src/ui/hooks/use-api-data.jsx';
import {ProjectDashboard} from '../../../../src/ui/routes/project-dashboard/project-dashboard.jsx';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @jest-environment jsdom */

/**
* @license Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
2 changes: 2 additions & 0 deletions packages/server/test/ui/storybook.test.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/** @jest-environment jsdom */

/**
* @license Copyright 2020 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Expand Down
10 changes: 10 additions & 0 deletions packages/utils/test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @license Copyright 2022 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';

module.exports = {
extends: ['../../../.eslintrc.tests.js'],
};
10 changes: 10 additions & 0 deletions packages/viewer/src/ui/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @license Copyright 2022 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';

module.exports = {
extends: ['../../../../.eslintrc.ui.js'],
};
10 changes: 10 additions & 0 deletions packages/viewer/test/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @license Copyright 2022 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
*/
'use strict';

module.exports = {
extends: ['../../../.eslintrc.tests.js'],
};
Loading

0 comments on commit 0fe68af

Please sign in to comment.