linter rules

This commit is contained in:
vigdorov
2020-07-09 12:08:18 +03:00
parent f0500e5c15
commit 341fea6608
2 changed files with 97 additions and 2 deletions

View File

@ -12,6 +12,87 @@
"rules": { "rules": {
"no-console": "warn", "no-console": "warn",
"semi": "error", "semi": "error",
"quotes": ["error", "single"] "quotes": ["error", "single"],
"array-callback-return": [
"error",
{
"allowImplicit": true,
"checkForEach": true
}
],
"default-case": "error",
"default-param-last": "error",
"no-alert": "warn",
"no-constructor-return": "error",
"no-else-return": "error",
"no-empty-function": "error",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-new": "error",
"no-param-reassign": "error",
"no-sequences": "error",
"no-useless-concat": "error",
"prefer-promise-reject-errors": "error",
"require-await": "error",
"wrap-iife": ["error", "inside"],
"yoda": "error",
"no-shadow": "error",
"no-use-before-define": "error",
"array-bracket-spacing": ["error", "never"],
"block-spacing": ["error", "never"],
"brace-style": ["error", "1tbs", {"allowSingleLine": true}],
"camelcase": "error",
"capitalized-comments": ["error"],
"comma-dangle": ["error", "only-multiline"],
"comma-spacing": ["error", {"before": false, "after": true}],
"computed-property-spacing": ["error", "never"],
"eol-last": ["error", "always"],
"func-call-spacing": ["error", "never"],
"func-style": ["error", "expression"],
"indent": ["error", 4],
"keyword-spacing": ["error", {"before": true}],
"line-comment-position": ["error", {"position": "above"}],
"linebreak-style": ["error", "unix"],
"lines-between-class-members": ["error", "always"],
"max-len": [
"warn",
{
"code": 120,
"ignoreComments": true,
"ignoreUrls": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true,
"ignoreRegExpLiterals": true
}
],
"multiline-comment-style": ["error", "starred-block"],
"new-cap": "error",
"new-parens": "error",
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 1 }],
"no-bitwise": "error",
"no-inline-comments": "error",
"no-lonely-if": "error",
"no-multi-assign": "error",
"no-multiple-empty-lines": ["error", { "max": 1}],
"no-nested-ternary": "error",
"no-plusplus": "error",
"no-trailing-spaces": "error",
"object-curly-spacing": ["error", "never"],
"object-property-newline": ["error", { "allowAllPropertiesOnSameLine": true }],
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
"space-before-blocks": "error",
"space-before-function-paren": ["error", "always"],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"arrow-parens": ["error", "always"],
"arrow-spacing": "error",
"no-duplicate-imports": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"no-var": "error",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-template": "error",
"template-curly-spacing": "error"
} }
} }

View File

@ -4,7 +4,7 @@ import 'bootstrap';
// ! TODO: 5-14 строчки удалить, после теста компонента // ! TODO: 5-14 строчки удалить, после теста компонента
import TestModal from './components/test-modal'; import TestModal from './components/test-modal';
import TestButton from './components/test-button'; import {TestButton} from './components/test-button';
const testModal = new TestModal(); const testModal = new TestModal();
const testButton = new TestButton(); const testButton = new TestButton();
@ -12,3 +12,17 @@ const testButton = new TestButton();
testButton.subscribe('click', () => { testButton.subscribe('click', () => {
testModal.show(); testModal.show();
}); });
export const foo = function () {
// Sdf
console.log('dfg');
alert('dfg');
};
const x = {
f: 5,
g: 7,
k: 9
};
x + 3;