Jelajahi Sumber

add setting files for linting

Yuki Takei 7 tahun lalu
induk
melakukan
2b19fb1bea

+ 6 - 0
packages/growi-commons/.eslintignore

@@ -0,0 +1,6 @@
+/.github/**
+/.vscode/**
+/node_modules/**
+/public/**
+/test/**
+/tmp/**

+ 42 - 0
packages/growi-commons/.eslintrc.js

@@ -0,0 +1,42 @@
+module.exports = {
+  extends: [
+    'weseek',
+    'weseek/react',
+  ],
+  env: {
+    mocha: true,
+    jquery: true,
+  },
+  globals: {
+    $: true,
+    jquery: true,
+    emojione: true,
+    hljs: true,
+    window: true,
+  },
+  plugins: [
+    'chai-friendly',
+  ],
+  rules: {
+    'indent': [
+      'error',
+      2,
+      {
+        SwitchCase: 1,
+        ignoredNodes: ['JSXElement *', 'JSXElement', 'JSXAttribute', 'JSXSpreadAttribute'],
+        ArrayExpression: 'first',
+        FunctionDeclaration: { body: 1, parameters: 2 },
+        FunctionExpression: { body: 1, parameters: 2 },
+      },
+    ],
+    'react/jsx-filename-extension': [
+      'warn',
+      { extensions: ['.jsx']},
+    ],
+    // eslint-plugin-import rules
+    'import/no-unresolved': [2, { ignore: ['^@'] }], // ignore @alias/..., @commons/..., ...
+    // eslint-plugin-chai-friendly rules
+    'no-unused-expressions': 0,
+    'chai-friendly/no-unused-expressions': 2,
+  },
+};

+ 0 - 0
packages/growi-commons/.prettierignore


+ 5 - 0
packages/growi-commons/.prettierrc

@@ -0,0 +1,5 @@
+{
+  "printWidth": 160,
+  "singleQuote": true,
+  "trailingComma": "all"
+}

+ 18 - 0
packages/growi-commons/.stylelintrc.json

@@ -0,0 +1,18 @@
+{
+  "extends": [
+    "stylelint-config-recess-order",
+    "./node_modules/prettier-stylelint/config.js"
+  ],
+  "ignoreFiles": [
+  ],
+  "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"
+  }
+}

+ 3 - 1
packages/growi-commons/package.json

@@ -26,13 +26,15 @@
   "dependencies": {},
   "homepage": "https://github.com/weseek/growi-commons#readme",
   "devDependencies": {
+    "babel-eslint": "^10.0.1",
     "babel-preset-env": "^1.7.0",
     "babel-preset-react": "^6.24.1",
     "eslint": "^5.15.1",
     "eslint-config-weseek": "^1.0.1",
     "eslint-plugin-chai-friendly": "^0.4.1",
     "eslint-plugin-import": "^2.16.0",
-    "eslint-plugin-react": "^7.12.4"
+    "eslint-plugin-react": "^7.12.4",
+    "prettier-stylelint": "^0.4.2"
   },
   "engines": {
     "node": ">=8.11.1 <11",

File diff ditekan karena terlalu besar
+ 851 - 25
packages/growi-commons/yarn.lock


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini