diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..a65b41774 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +lib diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..4c958ad42 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,51 @@ +{ + "extends": ["eslint:recommended"], + "parserOptions": { + "sourceType": "module", + "ecmaVersion": 2022 + }, + "env": { + "browser": true, + "es6": true + }, + "rules": { + "no-undef": ["error"], + "no-restricted-globals": ["error", "event", "self"], + "no-const-assign": ["error"], + "no-debugger": ["error"], + "no-dupe-class-members": ["error"], + "no-dupe-keys": ["error"], + "no-dupe-args": ["error"], + "no-dupe-else-if": ["error"], + "no-unsafe-negation": ["error"], + "no-duplicate-imports": ["error"], + "valid-typeof": ["error"], + "no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": false, "caughtErrors": "all" }], + "curly": ["error", "all"], + "no-restricted-syntax": ["error", "PrivateIdentifier"], + "prefer-const": ["error", { + "destructuring": "all", + "ignoreReadBeforeAssign": true + }], + "no-console": ["warn"], + "no-var": ["error"], + "arrow-body-style": ["error", "as-needed"], + "arrow-parens": ["error"], + "brace-style": ["error"], + "object-curly-spacing": ["error", "always"], + "array-bracket-spacing": ["error"], + "comma-dangle": ["error", "always-multiline"], + "semi": ["error", "always"], + "quotes": ["error", "double"], + "indent": ["error", 4, { "SwitchCase": 1 }], + "eol-last": ["error"], + "no-multiple-empty-lines": ["error"], + "no-trailing-spaces": ["error"] + }, + "globals": { + "diff_match_patch": "readonly", + "$": "readonly", + "jQuery": "readonly", + "Chart": "readonly" + } +} diff --git a/.gitignore b/.gitignore index 776409db1..3678f2786 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ runbot/static/nginx runbot/static/databases runbot/static/docker runbot/static/docker-registry +# npm files +node_modules +package-lock.json diff --git a/package.json b/package.json new file mode 100644 index 000000000..0b0fba345 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "devDependencies": { + "eslint": "^8.27.0" + } +}