Skip to content

Commit

Permalink
Fixes for eslint & precommit configuration (cvat-ai#2352)
Browse files Browse the repository at this point in the history
* Fixed some codacy configs, fixed commiting with lint-stage

* Improved code

* Fixed header

* Fixed headers

* Removed extra dependencies

* Updated some packages (fixed critical vulnerabilities)
  • Loading branch information
bsekachev authored Oct 24, 2020
1 parent 7512fd6 commit 0576cb7
Show file tree
Hide file tree
Showing 42 changed files with 975 additions and 656 deletions.
13 changes: 7 additions & 6 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2018-2020 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand All @@ -9,15 +9,16 @@ module.exports = {
es6: true,
jquery: true,
qunit: true,
'jest/globals': true,
'cypress/globals': true,
},
parserOptions: {
sourceType: 'script',
},
plugins: ['requirejs', 'jest', 'cypress', 'eslint-plugin-header'],
extends: ['eslint:recommended', 'plugin:requirejs/recommended', 'prettier'],
plugins: ['eslint-plugin-header'],
extends: ['eslint:recommended', 'prettier'],
rules: {
'header/header': [2, '.header.js'],
'header/header': [2, 'line', [{
pattern: ' {1}Copyright \\(C\\) (?:20\\d{2}-)?2020 Intel Corporation',
template: ' Copyright (C) 2020 Intel Corporation'
}, '', ' SPDX-License-Identifier: MIT']],
},
};
3 changes: 0 additions & 3 deletions .header.js

This file was deleted.

4 changes: 1 addition & 3 deletions cvat-canvas/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2019-2020 Intel Corporation
//
// SPDX-License-Identifier: MIT

module.exports = {
env: {
node: true,
browser: true,
es6: true,
},
parserOptions: {
parser: '@typescript-eslint/parser',
Expand Down
2 changes: 1 addition & 1 deletion cvat-canvas/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2019-2020 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down
5 changes: 3 additions & 2 deletions cvat-core/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2018-2020 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand All @@ -9,13 +9,14 @@ module.exports = {
es6: true,
jquery: true,
qunit: true,
'jest/globals': true,
},
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
ecmaVersion: 2018,
},
plugins: ['security', 'no-unsanitized', 'no-unsafe-innerhtml'],
plugins: ['security', 'jest', 'no-unsanitized', 'no-unsafe-innerhtml'],
extends: ['eslint:recommended', 'plugin:security/recommended', 'plugin:no-unsanitized/DOM', 'airbnb-base'],
rules: {
'no-await-in-loop': [0],
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2019-2020 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down
2 changes: 1 addition & 1 deletion cvat-core/jsdoc.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2020 Intel Corporation
// Copyright (C) 2019-2020 Intel Corporation
//
// SPDX-License-Identifier: MIT

Expand Down
Loading

0 comments on commit 0576cb7

Please sign in to comment.