summaryrefslogtreecommitdiff
path: root/packages/shared
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2021-11-18 23:32:43 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2021-11-18 23:32:43 +0900
commit73b5c129278bbcc19a95f2c599ac76f68f023c3a (patch)
tree62c4198ab091c14214eb3e552352a2ef41ee9055 /packages/shared
parentUpdate CHANGELOG.md (diff)
downloadsharkey-73b5c129278bbcc19a95f2c599ac76f68f023c3a.tar.gz
sharkey-73b5c129278bbcc19a95f2c599ac76f68f023c3a.tar.bz2
sharkey-73b5c129278bbcc19a95f2c599ac76f68f023c3a.zip
introduce lint for client
Resolve #7998
Diffstat (limited to 'packages/shared')
-rw-r--r--packages/shared/.eslintrc.js69
1 files changed, 69 insertions, 0 deletions
diff --git a/packages/shared/.eslintrc.js b/packages/shared/.eslintrc.js
new file mode 100644
index 0000000000..9eccf3bd58
--- /dev/null
+++ b/packages/shared/.eslintrc.js
@@ -0,0 +1,69 @@
+module.exports = {
+ root: true,
+ parser: '@typescript-eslint/parser',
+ plugins: [
+ '@typescript-eslint',
+ 'import'
+ ],
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:import/recommended',
+ 'plugin:import/typescript'
+ ],
+ rules: {
+ 'indent': ['warn', 'tab', {
+ 'SwitchCase': 1,
+ 'MemberExpression': 'off',
+ 'flatTernaryExpressions': true,
+ 'ArrayExpression': 'first',
+ 'ObjectExpression': 'first',
+ }],
+ 'eol-last': ['error', 'always'],
+ 'semi': ['error', 'always'],
+ 'quotes': ['warn', 'single'],
+ 'comma-dangle': ['warn', 'always-multiline'],
+ 'keyword-spacing': ['error', {
+ 'before': true,
+ 'after': true,
+ }],
+ 'key-spacing': ['error', {
+ 'beforeColon': false,
+ 'afterColon': true,
+ }],
+ /* TODO: path aliasを使わないとwarnする
+ 'no-restricted-imports': ['warn', {
+ 'patterns': [
+ ]
+ }],
+ */
+ 'no-multi-spaces': ['error'],
+ 'no-var': ['error'],
+ 'prefer-arrow-callback': ['error'],
+ 'no-throw-literal': ['warn'],
+ 'no-param-reassign': ['warn'],
+ 'no-constant-condition': ['warn'],
+ 'no-empty-pattern': ['warn'],
+ 'no-async-promise-executor': ['off'],
+ 'no-useless-escape': ['off'],
+ 'no-multi-spaces': ['warn'],
+ 'no-multiple-empty-lines': ['error', { 'max': 1 }],
+ 'no-control-regex': ['warn'],
+ 'no-empty': ['warn'],
+ 'no-inner-declarations': ['off'],
+ 'no-sparse-arrays': ['off'],
+ 'nonblock-statement-body-position': ['error', 'beside'],
+ 'object-curly-spacing': ['error', 'always'],
+ 'space-infix-ops': ['error'],
+ 'space-before-blocks': ['error', 'always'],
+ '@typescript-eslint/no-var-requires': ['warn'],
+ '@typescript-eslint/no-inferrable-types': ['warn'],
+ '@typescript-eslint/no-empty-function': ['off'],
+ '@typescript-eslint/no-non-null-assertion': ['warn'],
+ '@typescript-eslint/no-misused-promises': ['error', {
+ 'checksVoidReturn': false,
+ }],
+ 'import/no-unresolved': ['off'],
+ 'import/no-default-export': ['warn'],
+ },
+};