Skip to content

Commit

Permalink
Eslint-Prettier integration & pre commit hook (#2272)
Browse files Browse the repository at this point in the history
* Eslint prettier integrations and precommit hook on fly

* CHANGELOG update and package.json version patch
  • Loading branch information
vnishukov authored Oct 9, 2020
1 parent a4e8a98 commit 678f5b9
Show file tree
Hide file tree
Showing 8 changed files with 31,342 additions and 30,208 deletions.
874 changes: 480 additions & 394 deletions CHANGELOG.md

Large diffs are not rendered by default.

41 changes: 21 additions & 20 deletions cvat-ui/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
// SPDX-License-Identifier: MIT

module.exports = {
'env': {
'node': true,
'browser': true,
'es6': true,
env: {
node: true,
browser: true,
es6: true,
},
'parserOptions': {
'parser': '@typescript-eslint/parser',
'ecmaVersion': 6,
'project': './tsconfig.json',
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 6,
project: './tsconfig.json',
},
'plugins': [
'@typescript-eslint',
'import',
],
'ignorePatterns': ['*.svg', '*.scss'],
'extends': [
plugins: ['@typescript-eslint', 'import', 'eslint-plugin-header'],
ignorePatterns: ['*.svg', '*.scss'],
extends: [
'plugin:@typescript-eslint/recommended',
'airbnb-typescript',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'prettier',
'prettier/@typescript-eslint',
'prettier/react',
],
'rules': {
rules: {
'@typescript-eslint/indent': ['warn', 4],
'react/jsx-indent': ['warn', 4],
'react/jsx-indent-props': ['warn', 4],
Expand All @@ -34,16 +34,17 @@ module.exports = {
'arrow-parens': ['error', 'always'],
'@typescript-eslint/no-explicit-any': [0],
'@typescript-eslint/explicit-function-return-type': ['warn', { allowExpressions: true }],
'no-restricted-syntax': [0, {'selector': 'ForOfStatement'}],
'no-restricted-syntax': [0, { selector: 'ForOfStatement' }],
'no-plusplus': [0],
'lines-between-class-members': 0,
'react/no-did-update-set-state': 0, // https://github.com/airbnb/javascript/issues/1875
'header/header': [2, '.header-tpl.ts'],
},
'settings': {
settings: {
'import/resolver': {
'typescript': {
'directory': './tsconfig.json'
}
typescript: {
directory: './tsconfig.json',
},
},
},
};
1 change: 1 addition & 0 deletions cvat-ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/dist
/build
/yarn.lock
.eslintcache

3 changes: 3 additions & 0 deletions cvat-ui/.header-tpl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Copyright (C) 2020 Intel Corporation
//
// SPDX-License-Identifier: MIT
19 changes: 19 additions & 0 deletions cvat-ui/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"htmlWhitespaceSensitivity": "css",
"insertPragma": false,
"jsxBracketSameLine": false,
"jsxSingleQuote": true,
"printWidth": 120,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"requirePragma": false,
"semi": true,
"singleQuote": true,
"tabWidth": 4,
"trailingComma": "all",
"useTabs": false,
"vueIndentScriptAndStyle": false
}
Loading

0 comments on commit 678f5b9

Please sign in to comment.