OSDN Git Service

BugTrack/2436 ESLint - Linting utility for JavaScript bugtrack_2411_doc_comment
authorumorigu <umorigu@gmail.com>
Wed, 25 Oct 2017 17:16:27 +0000 (02:16 +0900)
committerumorigu <umorigu@gmail.com>
Wed, 25 Oct 2017 17:16:27 +0000 (02:16 +0900)
Install utilities:

```
npm install
```

Use ESLint:

```
npm test
```

or

```
npx eslint skin/main.js
```

.eslintrc.json [new file with mode: 0644]
package.json [new file with mode: 0644]

diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644 (file)
index 0000000..5012dbf
--- /dev/null
@@ -0,0 +1,33 @@
+{
+    "extends": ["airbnb"],
+    "plugins": [],
+    "parserOptions": {
+        "sourceType": "script"
+    },
+    "env": {"browser": true},
+    "globals": {},
+    "rules": {
+        "no-console": 0,
+        "no-inner-declarations": "warn",
+        "no-var": 0,
+        "vars-on-top": 0,
+        "prefer-template": 0,
+        "prefer-arrow-callback": 0,
+        "space-before-function-paren": 0,
+        "no-plusplus": 0,
+        "prefer-destructuring": 0,
+        "no-continue": 0,
+        "func-names": 0,
+        "function-paren-newline": 0,
+        "comma-dangle": 0,
+        "object-shorthand": 0,
+        "object-curly-spacing": 0,
+        "operator-assignment": 0,
+        "no-multi-assign": 0,
+        "no-param-reassign": ["warn", { "props": false }],
+        "strict": ["error", "function"],
+        "lines-around-directive": 0,
+        "no-cond-assign": ["error", "except-parens"]
+    }
+}
+
diff --git a/package.json b/package.json
new file mode 100644 (file)
index 0000000..8410411
--- /dev/null
@@ -0,0 +1,22 @@
+{
+  "name": "pukiwiki",
+  "version": "1.0.0",
+  "description": "PukiWiki client JavaScript",
+  "main": "skin/main.js",
+  "directories": {
+    "lib": "lib"
+  },
+  "scripts": {
+    "test": "eslint skin/main.js skin/search2.js"
+  },
+  "author": "umorigu",
+  "license": "GPL-2.0",
+  "devDependencies": {
+    "eslint": "*",
+    "eslint-config-airbnb": "*",
+    "eslint-plugin-import": "*",
+    "eslint-plugin-jsx-a11y": "*",
+    "eslint-plugin-react": "*"
+  }
+}
+