From 6fbee8ecc9db702173e43a6a1cd0b2f8b4e29a6d Mon Sep 17 00:00:00 2001 From: umorigu Date: Thu, 26 Oct 2017 02:16:27 +0900 Subject: [PATCH] BugTrack/2436 ESLint - Linting utility for JavaScript Install utilities: ``` npm install ``` Use ESLint: ``` npm test ``` or ``` npx eslint skin/main.js ``` --- .eslintrc.json | 33 +++++++++++++++++++++++++++++++++ package.json | 22 ++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 .eslintrc.json create mode 100644 package.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..5012dbf --- /dev/null +++ b/.eslintrc.json @@ -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 index 0000000..8410411 --- /dev/null +++ b/package.json @@ -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": "*" + } +} + -- 2.11.0