Configured codacy && eslint instead of tslint (#631)
* Codacy setup for cvat-canvas, eslint instead of tslint * Added vscode config * Added codacy config * Added eslint config * Changed config * Changed codacy * Return root eslint file * Disable tslint manually * Remove custom disable * Reset codacy configmain
parent
58f30220df
commit
8e43dc75ad
@ -0,0 +1,22 @@
|
||||
{
|
||||
"python.pythonPath": ".env/bin/python",
|
||||
"eslint.enable": true,
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"typescript"
|
||||
],
|
||||
"eslint.workingDirectories": [
|
||||
{
|
||||
"directory": "./cvat-core",
|
||||
"changeProcessCWD": true
|
||||
},
|
||||
{
|
||||
"directory": "./cvat-canvas",
|
||||
"changeProcessCWD": true
|
||||
},
|
||||
{
|
||||
"directory": ".",
|
||||
"changeProcessCWD": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
'env': {
|
||||
'node': true,
|
||||
'browser': true,
|
||||
'es6': true,
|
||||
},
|
||||
'parserOptions': {
|
||||
'parser': '@typescript-eslint/parser',
|
||||
'ecmaVersion': 6,
|
||||
},
|
||||
'plugins': [
|
||||
'@typescript-eslint',
|
||||
'import',
|
||||
],
|
||||
'extends': [
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'airbnb-typescript/base',
|
||||
'plugin:import/errors',
|
||||
'plugin:import/warnings',
|
||||
'plugin:import/typescript',
|
||||
],
|
||||
'rules': {
|
||||
'@typescript-eslint/no-explicit-any': 0,
|
||||
'@typescript-eslint/indent': ['warn', 4],
|
||||
'no-plusplus': 0,
|
||||
'no-restricted-syntax': [
|
||||
0,
|
||||
{
|
||||
'selector': 'ForOfStatement'
|
||||
}
|
||||
],
|
||||
'no-continue': 0,
|
||||
'func-names': 0,
|
||||
'no-console': 0, // this rule deprecates console.log, console.warn etc. because 'it is not good in production code'
|
||||
'lines-between-class-members': 0,
|
||||
'import/prefer-default-export': 0, // works incorrect with interfaces
|
||||
},
|
||||
'settings': {
|
||||
'import/resolver': {
|
||||
'node': {
|
||||
'extensions': ['.ts', '.js', '.json'],
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Intel Corporation
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
module.exports = {
|
||||
defaultSeverity: 'error',
|
||||
extends: [
|
||||
'tslint:recommended',
|
||||
'tslint-config-airbnb'
|
||||
],
|
||||
jsRules: {},
|
||||
rulesDirectory: [],
|
||||
rules: {
|
||||
'ter-indent': ['warn', 4],
|
||||
// TypeScript guildline prevents interfaces names started with I
|
||||
// https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines#names
|
||||
'interface-name': false,
|
||||
'no-console': false,
|
||||
// Arrow functions doesn't use closure context, but sometimes we need it
|
||||
// At the same time typescript non-arrow functions are forbidden in TS
|
||||
// So, we forced to disable this rule
|
||||
'no-this-assignment': false,
|
||||
// Just a strange rule
|
||||
'no-shadowed-variable': false,
|
||||
// Don't prevent ++ and -- operations (the same like in eslint)
|
||||
'no-increment-decrement': false,
|
||||
},
|
||||
linterOptions: {
|
||||
include: ['src/*.ts']
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue