]> source.dussan.org Git - rspamd.git/commitdiff
[Test] Add JavaScript linting 2322/head
authorAlexander Moisseev <moiseev@mezonplus.ru>
Tue, 3 Jul 2018 08:24:40 +0000 (11:24 +0300)
committerAlexander Moisseev <moiseev@mezonplus.ru>
Tue, 3 Jul 2018 08:24:40 +0000 (11:24 +0300)
.circleci/config.yml
.eslintrc.json [new file with mode: 0644]
package.json [new file with mode: 0644]

index 51525aae0aac5549f2d8752c27988890f1fc27c7..400029d69eb6ac8a38db8a97df7e8552c242e34c 100644 (file)
@@ -119,11 +119,29 @@ jobs:
 
       - run: (exit $RETURN_CODE)
 
+  eslint:
+    docker:
+      - image: circleci/node:latest
+    steps:
+      - checkout
+      - restore_cache:
+          keys:
+          - v1-dependencies-{{ checksum "package.json" }}
+          # fallback to using the latest cache if no exact match is found
+          - v1-dependencies-
+      - run: npm install
+      - save_cache:
+          paths:
+            - node_modules
+          key: v1-dependencies-{{ checksum "package.json" }}
+      - run: ./node_modules/.bin/eslint ./
+
 workflows:
   version: 2
   build-and-test:
     jobs:
       - build
+      - eslint
       - rspamd-test:
           requires:
             - build
diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644 (file)
index 0000000..64c25a2
--- /dev/null
@@ -0,0 +1,8 @@
+{
+    "env": {
+        "browser": true
+    },
+    "rules": {
+        "newline-per-chained-call": "off"
+    }
+}
diff --git a/package.json b/package.json
new file mode 100644 (file)
index 0000000..14ee2bd
--- /dev/null
@@ -0,0 +1,6 @@
+{
+    "devDependencies": {
+        "eslint": "*"
+    },
+    "eslintIgnore": ["*.min.js", "interface/js/lib/domReady.js"]
+}