From 559372ec96b460c45953c4c00f931f7fee36dce7 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Wed, 12 Oct 2022 22:32:02 -0700 Subject: [PATCH] [eslint] add eslint --- .eslintrc | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 4 +++ 2 files changed, 75 insertions(+) create mode 100644 .eslintrc diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..4bd2fba --- /dev/null +++ b/.eslintrc @@ -0,0 +1,71 @@ +{ + "root": true, + + "extends": "@ljharb/eslint-config/node/0.4", + + "rules": { + "array-bracket-newline": 0, + "array-bracket-spacing": 1, + "array-callback-return": 1, + "array-element-newline": 0, + "brace-style": 1, + "camelcase": 1, + "comma-dangle": 1, + "comma-spacing": 1, + "complexity": 0, + "consistent-return": 1, + "curly": 1, + "dot-notation": 1, + "eqeqeq": 1, + "func-style": 1, + "function-call-argument-newline": 1, + "function-paren-newline": 1, + "global-require": 1, + "indent": [1, 4], + "key-spacing": 1, + "max-lines-per-function": 1, + "max-statements-per-line": 1, + "multiline-comment-style": 0, + "new-parens": 1, + "no-else-return": 1, + "no-extra-bind": 1, + "no-extra-parens": 1, + "no-extra-semi": 1, + "no-multi-assign": 1, + "no-new-wrappers": 1, + "no-param-reassign": 1, + "no-plusplus": 1, + "no-proto": 1, + "no-restricted-syntax": 1, + "no-shadow": 1, + "no-sparse-arrays": 1, + "no-trailing-spaces": 1, + "no-undef": 1, + "no-underscore-dangle": 1, + "no-unused-vars": 1, + "no-use-before-define": 1, + "no-useless-concat": 1, + "object-curly-newline": 1, + "one-var-declaration-per-line": 1, + "operator-linebreak": 1, + "quote-props": 1, + "quotes": 1, + "semi-style": 1, + "semi": 1, + "sort-keys": 0, + "space-before-function-paren": 1, + "space-unary-ops": 1, + "spaced-comment": 1, + "strict": 1, + "wrap-iife": 1, + }, + + "overrides": [ + { + "files": "examples/**", + "rules": { + "no-console": 0, + }, + }, + ], +} diff --git a/package.json b/package.json index b31fa96..3e4be9e 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,14 @@ "test": "test" }, "devDependencies": { + "@ljharb/eslint-config": "^21.0.0", "aud": "^2.0.1", + "eslint": "=8.8.0", "tape": "^5.6.1" }, "scripts": { + "lint": "eslint --ext=js,mjs .", + "pretest": "npm run lint", "tests-only": "tape 'test/**/*.js'", "test": "npm run tests-only", "posttest": "aud --production"