瀏覽代碼

eslint-config

Mokhtar Naamani 4 年之前
父節點
當前提交
09f1332846
共有 4 個文件被更改,包括 60 次插入1 次删除
  1. 5 0
      .eslintrc.js
  2. 31 0
      eslint-config/index.js
  3. 22 0
      eslint-config/package.json
  4. 2 1
      package.json

+ 5 - 0
.eslintrc.js

@@ -0,0 +1,5 @@
+module.exports = {
+  extends: [
+    '@joystream/eslint-config'
+  ],
+};

+ 31 - 0
eslint-config/index.js

@@ -0,0 +1,31 @@
+module.exports = {
+  env: {
+    es6: true,
+  },
+  globals: {
+    Atomics: "readonly",
+    SharedArrayBuffer: "readonly",
+  },
+  parser: "@typescript-eslint/parser",
+  parserOptions: {
+    ecmaFeatures: {
+      jsx: true,
+    },
+    ecmaVersion: 2019,
+    sourceType: "module",
+  },
+  extends: [
+    "plugin:react/recommended",
+    "standard",
+    "plugin:jsx-a11y/recommended",
+    "plugin:prettier/recommended",
+  ],
+  plugins: ["react", "react-hooks"],
+  rules: {
+    "react-hooks/rules-of-hooks": "error",
+    "react-hooks/exhaustive-deps": "warn",
+  },
+  settings: {
+    version: "detect",
+  },
+};

+ 22 - 0
eslint-config/package.json

@@ -0,0 +1,22 @@
+{
+  "name": "@joystream/eslint-config",
+  "version": "1.0.0",
+  "description": "joystream eslint shared config",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/joystream/joystream.git"
+  },
+  "author": "Joystream contributors",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/joystream/joystream/issues"
+  },
+  "homepage": "https://github.com/joystream/joystream#readme",
+  "peerDependencies": {
+    "eslint": ">= 3"
+  }
+}

+ 2 - 1
package.json

@@ -14,7 +14,8 @@
 		"cli",
 		"types",
 		"pioneer",
-		"pioneer/packages/*"
+		"pioneer/packages/*",
+		"eslint-config"
 	],
 	"resolutions": {
 		"@polkadot/api": "^0.96.1",