Explorar el Código

organize lint settings

Yuki Takei hace 4 años
padre
commit
d694b3cfe0

+ 1 - 0
.eslintignore

@@ -0,0 +1 @@
+node_modules/**

+ 0 - 0
packages/slack/.eslintrc.js → .eslintrc.js


+ 0 - 0
packages/app/.prettierrc → .prettierrc


+ 15 - 0
.stylelintrc.json

@@ -0,0 +1,15 @@
+{
+  "extends": [
+    "stylelint-config-recess-order"
+  ],
+  "rules": {
+    "indentation": 2,
+    "string-quotes": "single",
+    "rule-empty-line-before": [ "always-multi-line", {
+      "except": ["after-single-line-comment", "first-nested"],
+      "ignore": ["after-comment", "inside-block"]
+    } ],
+    "selector-combinator-space-before": "always",
+    "selector-combinator-space-after": "always"
+  }
+}

+ 0 - 6
package.json

@@ -41,12 +41,6 @@
     "clean:report": "rimraf -- report",
     "clean": "npm-run-all -p clean:*",
     "console": "env-cmd -f config/env.dev.js node --experimental-repl-await src/server/console.js",
-    "lint:js:fix": "eslint \"**/*.{js,jsx}\" --fix",
-    "lint:js": "eslint \"**/*.{js,jsx}\"",
-    "lint:styles:fix": "stylelint --fix src/client/styles/scss/**/*.scss",
-    "lint:styles": "stylelint src/client/styles/scss/**/*.scss",
-    "lint:swagger2openapi": "node node_modules/swagger2openapi/oas-validate tmp/swagger.json",
-    "lint": "npm-run-all -p lint:js lint:styles lint:swagger2openapi",
     "migrate": "npm run migrate:up",
     "migrate:create": "migrate-mongo create -f config/migrate.js -- ",
     "migrate:status": "migrate-mongo status -f config/migrate.js",

+ 2 - 5
packages/app/.eslintignore

@@ -1,9 +1,6 @@
-/.github/**
-/.vscode/**
-/node_modules/**
 /packages/**
 /public/**
-/src/client/js/legacy/thirdparty-js/**
-/src/client/js/util/reveal/plugins/markdown.js
+/src/client/legacy/thirdparty-js/**
+/src/client/util/reveal/plugins/markdown.js
 /src/linter-checker/**
 /tmp/**

+ 1 - 0
packages/app/.eslintrc.js

@@ -1,4 +1,5 @@
 module.exports = {
+  root: true, // https://eslint.org/docs/user-guide/configuring/configuration-files#cascading-and-hierarchy
   extends: [
     'weseek',
     'weseek/react',

+ 1 - 1
packages/app/.stylelintrc.json

@@ -3,7 +3,7 @@
     "stylelint-config-recess-order"
   ],
   "ignoreFiles": [
-    "src/client/styles/scss/_override-bootstrap-variables.scss",
+    "src/styles/_override-bootstrap-variables.scss",
     "src/linter-checker/test.scss"
   ],
   "rules": {

+ 7 - 1
packages/app/package.json

@@ -4,7 +4,13 @@
   "license": "MIT",
   "scripts": {
     "build": "cd ../../ && env-cmd -f config/env.prod.js webpack --config config/webpack.prod.js --profile --bail",
-    "prebuild": "cd ../../ && yarn plugin:def && yarn resource"
+    "prebuild": "cd ../../ && yarn plugin:def && yarn resource",
+    "lint:js:fix": "eslint \"**/*.{js,jsx}\" --fix",
+    "lint:js": "eslint \"**/*.{js,jsx}\"",
+    "lint:styles:fix": "stylelint --fix src/**/*.scss",
+    "lint:styles": "stylelint src/**/*.scss",
+    "lint:swagger2openapi": "node node_modules/swagger2openapi/oas-validate tmp/swagger.json",
+    "lint": "npm-run-all -p lint:js lint:styles lint:swagger2openapi"
   },
   "// comments for dependencies": {
     "openid-client": "Node.js 12 or higher is required for openid-client@3 and above.",

+ 1 - 2
packages/slack/.eslintignore

@@ -1,2 +1 @@
-/lib/**
-/node_modules/**
+/dist/**

+ 0 - 1
packages/slackbot-proxy/.eslintignore

@@ -1,2 +1 @@
 /dist/**
-/node_modules/**

+ 0 - 30
packages/slackbot-proxy/.eslintrc.js

@@ -1,30 +0,0 @@
-module.exports = {
-  parser: '@typescript-eslint/parser',
-  extends: [
-    'weseek',
-    'weseek/typescript',
-    'plugin:jest/recommended',
-  ],
-  env: {
-    'jest/globals': true,
-  },
-  globals: {
-  },
-  plugins: [
-    'jest',
-  ],
-  rules: {
-    'import/prefer-default-export': 'off',
-    '@typescript-eslint/no-explicit-any': 'off',
-    indent: [
-      'error',
-      2,
-      {
-        SwitchCase: 1,
-        ArrayExpression: 'first',
-        FunctionDeclaration: { body: 1, parameters: 2 },
-        FunctionExpression: { body: 1, parameters: 2 },
-      },
-    ],
-  },
-};