Skip to content

Commit 0576cb7

Browse files
authored
Fixes for eslint & precommit configuration (cvat-ai#2352)
* Fixed some codacy configs, fixed commiting with lint-stage * Improved code * Fixed header * Fixed headers * Removed extra dependencies * Updated some packages (fixed critical vulnerabilities)
1 parent 7512fd6 commit 0576cb7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+975
-656
lines changed

.eslintrc.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2020 Intel Corporation
1+
// Copyright (C) 2018-2020 Intel Corporation
22
//
33
// SPDX-License-Identifier: MIT
44

@@ -9,15 +9,16 @@ module.exports = {
99
es6: true,
1010
jquery: true,
1111
qunit: true,
12-
'jest/globals': true,
13-
'cypress/globals': true,
1412
},
1513
parserOptions: {
1614
sourceType: 'script',
1715
},
18-
plugins: ['requirejs', 'jest', 'cypress', 'eslint-plugin-header'],
19-
extends: ['eslint:recommended', 'plugin:requirejs/recommended', 'prettier'],
16+
plugins: ['eslint-plugin-header'],
17+
extends: ['eslint:recommended', 'prettier'],
2018
rules: {
21-
'header/header': [2, '.header.js'],
19+
'header/header': [2, 'line', [{
20+
pattern: ' {1}Copyright \\(C\\) (?:20\\d{2}-)?2020 Intel Corporation',
21+
template: ' Copyright (C) 2020 Intel Corporation'
22+
}, '', ' SPDX-License-Identifier: MIT']],
2223
},
2324
};

.header.js

-3
This file was deleted.

cvat-canvas/.eslintrc.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
// Copyright (C) 2020 Intel Corporation
1+
// Copyright (C) 2019-2020 Intel Corporation
22
//
33
// SPDX-License-Identifier: MIT
44

55
module.exports = {
66
env: {
77
node: true,
8-
browser: true,
9-
es6: true,
108
},
119
parserOptions: {
1210
parser: '@typescript-eslint/parser',

cvat-canvas/postcss.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2020 Intel Corporation
1+
// Copyright (C) 2019-2020 Intel Corporation
22
//
33
// SPDX-License-Identifier: MIT
44

cvat-core/.eslintrc.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2020 Intel Corporation
1+
// Copyright (C) 2018-2020 Intel Corporation
22
//
33
// SPDX-License-Identifier: MIT
44

@@ -9,13 +9,14 @@ module.exports = {
99
es6: true,
1010
jquery: true,
1111
qunit: true,
12+
'jest/globals': true,
1213
},
1314
parserOptions: {
1415
parser: 'babel-eslint',
1516
sourceType: 'module',
1617
ecmaVersion: 2018,
1718
},
18-
plugins: ['security', 'no-unsanitized', 'no-unsafe-innerhtml'],
19+
plugins: ['security', 'jest', 'no-unsanitized', 'no-unsafe-innerhtml'],
1920
extends: ['eslint:recommended', 'plugin:security/recommended', 'plugin:no-unsanitized/DOM', 'airbnb-base'],
2021
rules: {
2122
'no-await-in-loop': [0],

cvat-core/jest.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2020 Intel Corporation
1+
// Copyright (C) 2019-2020 Intel Corporation
22
//
33
// SPDX-License-Identifier: MIT
44

cvat-core/jsdoc.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (C) 2020 Intel Corporation
1+
// Copyright (C) 2019-2020 Intel Corporation
22
//
33
// SPDX-License-Identifier: MIT
44

0 commit comments

Comments
 (0)