Skip to content

Commit 0fe68af

Browse files
authored
chore(deps): update lint deps and use implicit configuration (GoogleChrome#751)
1 parent eb44b57 commit 0fe68af

21 files changed

+1674
-2070
lines changed

.eslintrc.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
'use strict';
77

88
module.exports = {
9+
root: true,
910
// Start with google standard style and disable the prettier-controlled rules
1011
// https://github.com/google/eslint-config-google/blob/master/index.js
1112
extends: [
@@ -17,6 +18,7 @@ module.exports = {
1718
],
1819
// Use the prettier plugin to enforce prettier violations
1920
plugins: ['prettier', 'import'],
21+
ignorePatterns: ['dist/'],
2022
env: {
2123
node: true,
2224
es6: true,
@@ -65,8 +67,9 @@ module.exports = {
6567
'valid-jsdoc': 0,
6668
'arrow-parens': 0,
6769
},
70+
parser: '@typescript-eslint/parser',
6871
parserOptions: {
69-
ecmaVersion: 2018,
72+
ecmaVersion: 2020,
7073
ecmaFeatures: {
7174
globalReturn: true,
7275
jsx: false,

.eslintrc.tests.js

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
module.exports = {
99
extends: ['./.eslintrc.js'],
10+
plugins: ['jest'],
11+
env: {
12+
'jest/globals': true,
13+
},
1014
rules: {
1115
'import/no-extraneous-dependencies': 'off',
1216
},

.eslintrc.ui.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ module.exports = {
2424
varsIgnorePattern: '(^_$|^h$)',
2525
},
2626
],
27+
strict: 'off',
2728
},
28-
parser: 'babel-eslint',
2929
parserOptions: {
30-
ecmaVersion: 2019,
30+
ecmaVersion: 2020,
3131
ecmaFeatures: {
3232
jsx: true,
3333
},

jest.config.js

+9-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@
66
'use strict';
77

88
module.exports = {
9+
preset: 'ts-jest/presets/js-with-ts-esm',
10+
globals: {
11+
'ts-jest': {
12+
// Disable typechecking.
13+
diagnostics: false,
14+
isolatedModules: true,
15+
},
16+
},
17+
testEnvironment: 'node',
918
testRunner: require.resolve('jest-circus/runner'),
1019
globalSetup: require.resolve('./packages/server/test/storybook-setup.js'),
1120
globalTeardown: require.resolve('./packages/server/test/storybook-teardown.js'),
12-
transform: {
13-
'.*jsx$': 'babel-jest',
14-
},
1521
moduleNameMapper: {
1622
'\\.css$': 'identity-obj-proxy',
1723
'\\.(svg|png|jpg|jpeg)$': '<rootDir>/packages/server/test/__mocks__/file-mock.js',

package.json

+13-15
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@
2020
"test:quick": "npm run test:typecheck && npm run test:lint && npm run test:unit -- --testPathIgnorePatterns=\"cli.test.js\"",
2121
"test:typecheck": "tsc -p .",
2222
"test:lint": "npm run test:lint:js && npm run test:lint:jsx && npm run test:lint:tests",
23+
"test:lint:fix": "npm run test:lint:js --fix && npm run test:lint:jsx --fix && npm run test:lint:tests --fix",
2324
"test:lint:js": "eslint ./packages/*/src",
24-
"test:lint:jsx": "eslint -c ./.eslintrc.ui.js --ext jsx ./packages/server/src/ui ./packages/viewer/src/ui",
25-
"test:lint:tests": "eslint -c ./.eslintrc.tests.js ./packages/*/test",
25+
"test:lint:jsx": "eslint ./packages/server/src/ui ./packages/viewer/src/ui",
26+
"test:lint:tests": "eslint ./packages/*/test",
2627
"test:docker": "bash scripts/test-docker.sh",
2728
"test:unit": "jest --maxWorkers=2"
2829
},
2930
"devDependencies": {
30-
"@babel/core": "^7.10.2",
31-
"@babel/plugin-transform-react-jsx": "^7.10.1",
32-
"@babel/preset-env": "^7.10.1",
3331
"@chialab/esbuild-plugin-html": "^0.12.2",
3432
"@storybook/addon-actions": "^6.4.13",
3533
"@storybook/addon-links": "^6.4.13",
@@ -58,20 +56,19 @@
5856
"@types/uuid": "^8.3.0",
5957
"@types/yargs": "^12.0.8",
6058
"@types/yargs-parser": "^11.0.0",
61-
"babel-eslint": "^10.1.0",
62-
"babel-jest": "^26.0.1",
63-
"babel-loader": "^8.1.0",
59+
"@typescript-eslint/parser": "^5.10.2",
6460
"esbuild": "^0.14.11",
65-
"eslint": "^7.1.0",
61+
"eslint": "^8.8.0",
6662
"eslint-config-google": "^0.14.0",
67-
"eslint-config-prettier": "^6.11.0",
63+
"eslint-config-prettier": "^8.3.0",
6864
"eslint-config-react": "^1.1.7",
69-
"eslint-plugin-import": "^2.20.2",
70-
"eslint-plugin-prettier": "^3.1.3",
71-
"eslint-plugin-react": "^7.20.0",
65+
"eslint-plugin-import": "^2.25.4",
66+
"eslint-plugin-jest": "^26.0.0",
67+
"eslint-plugin-prettier": "^4.0.0",
68+
"eslint-plugin-react": "^7.28.0",
7269
"identity-obj-proxy": "^3.0.0",
73-
"jest": "^25.0.0",
74-
"jest-circus": "^25.0.0",
70+
"jest": "^27.4.7",
71+
"jest-circus": "^27.4.6",
7572
"jest-fetch-mock": "^3.0.3",
7673
"jest-image-snapshot": "^4.5.1",
7774
"lerna": "^3.22.0",
@@ -84,6 +81,7 @@
8481
"puppeteer": "^13.1.2",
8582
"rimraf": "^3.0.2",
8683
"sqlite3": "^5.0.0",
84+
"ts-jest": "^27.1.3",
8785
"typescript": "^4.5.4"
8886
}
8987
}
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/**
2-
* @license Copyright 2019 Google Inc. All Rights Reserved.
2+
* @license Copyright 2022 Google Inc. All Rights Reserved.
33
* 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
44
* 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.
55
*/
66
'use strict';
77

88
module.exports = {
9-
presets: ['@babel/preset-env'],
10-
plugins: [['@babel/plugin-transform-react-jsx', {pragma: 'h'}]],
9+
extends: ['../../../.eslintrc.tests.js'],
1110
};

packages/server/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
"uuid": "^8.3.1"
3636
},
3737
"devDependencies": {
38-
"@babel/core": "^7.10.2",
3938
"clsx": "^1.0.4",
4039
"d3": "^5.15.0",
4140
"plotly.js": "^1.48.3",

packages/server/src/ui/.eslintrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @license Copyright 2022 Google Inc. All Rights Reserved.
3+
* 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
4+
* 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.
5+
*/
6+
'use strict';
7+
8+
module.exports = {
9+
extends: ['../../../../.eslintrc.ui.js'],
10+
};

packages/server/test/.eslintrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @license Copyright 2022 Google Inc. All Rights Reserved.
3+
* 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
4+
* 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.
5+
*/
6+
'use strict';
7+
8+
module.exports = {
9+
extends: ['../../../.eslintrc.tests.js'],
10+
};

packages/server/test/ui/.eslintrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @license Copyright 2022 Google Inc. All Rights Reserved.
3+
* 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
4+
* 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.
5+
*/
6+
'use strict';
7+
8+
module.exports = {
9+
extends: ['../../../../.eslintrc.tests.js', '../../../../.eslintrc.ui.js'],
10+
};

packages/server/test/ui/components/async-loader.test.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
/** @jest-environment jsdom */
2+
13
/**
24
* @license Copyright 2019 Google Inc. All Rights Reserved.
35
* 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
46
* 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.
57
*/
68

9+
/* eslint-env jest */
10+
711
import {h} from 'preact';
812
import {
913
AsyncLoader,

packages/server/test/ui/routes/build-view/build-view.test.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
/** @jest-environment jsdom */
2+
13
/**
24
* @license Copyright 2019 Google Inc. All Rights Reserved.
35
* 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
46
* 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.
57
*/
68

9+
/* eslint-env jest */
10+
711
import {h} from 'preact';
812
import {api} from '../../../../src/ui/hooks/use-api-data.jsx';
913
import {BuildView} from '../../../../src/ui/routes/build-view/build-view.jsx';

packages/server/test/ui/routes/build-view/lhr-comparison.test.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
/** @jest-environment jsdom */
2+
13
/**
24
* @license Copyright 2019 Google Inc. All Rights Reserved.
35
* 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
46
* 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.
57
*/
68

9+
/* eslint-env jest */
10+
711
import {h} from 'preact';
812
import {computeAuditGroups} from '../../../../src/ui/routes/build-view/lhr-comparison.jsx';
913
import {cleanup} from '../../../test-utils.js';

packages/server/test/ui/routes/project-dashboard/graphs/category-score-graph/score-line-graph.test.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
/** @jest-environment jsdom */
2+
13
/**
24
* @license Copyright 2020 Google Inc. All Rights Reserved.
35
* 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
46
* 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.
57
*/
68

9+
/* eslint-env jest */
10+
711
import {h} from 'preact';
812
import {buildMinMaxByBuildId} from '../../../../../../src/ui/routes/project-dashboard/graphs/category-score/score-line-graph';
913
import {cleanup} from '../../../../../test-utils.js';

packages/server/test/ui/routes/project-dashboard/project-dashboard.test.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
/** @jest-environment jsdom */
2+
13
/**
24
* @license Copyright 2019 Google Inc. All Rights Reserved.
35
* 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
46
* 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.
57
*/
68

9+
/* eslint-env jest */
10+
711
import {h} from 'preact';
812
import {api} from '../../../../src/ui/hooks/use-api-data.jsx';
913
import {ProjectDashboard} from '../../../../src/ui/routes/project-dashboard/project-dashboard.jsx';

packages/server/test/ui/routes/project-list/project-list.test.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @jest-environment jsdom */
2+
13
/**
24
* @license Copyright 2019 Google Inc. All Rights Reserved.
35
* 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

packages/server/test/ui/storybook.test.jsx

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/** @jest-environment jsdom */
2+
13
/**
24
* @license Copyright 2020 Google Inc. All Rights Reserved.
35
* 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

packages/utils/test/.eslintrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @license Copyright 2022 Google Inc. All Rights Reserved.
3+
* 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
4+
* 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.
5+
*/
6+
'use strict';
7+
8+
module.exports = {
9+
extends: ['../../../.eslintrc.tests.js'],
10+
};

packages/viewer/src/ui/.eslintrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @license Copyright 2022 Google Inc. All Rights Reserved.
3+
* 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
4+
* 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.
5+
*/
6+
'use strict';
7+
8+
module.exports = {
9+
extends: ['../../../../.eslintrc.ui.js'],
10+
};

packages/viewer/test/.eslintrc.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @license Copyright 2022 Google Inc. All Rights Reserved.
3+
* 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
4+
* 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.
5+
*/
6+
'use strict';
7+
8+
module.exports = {
9+
extends: ['../../../.eslintrc.tests.js'],
10+
};

0 commit comments

Comments
 (0)