mongodb-atlas-api-client
Version:
A mongodb atlas api client for nodejs.
205 lines (199 loc) • 6.63 kB
JavaScript
// eslint.config.js
const pluginJs = require("@eslint/js");
module.exports = [
pluginJs.configs.recommended,
{
languageOptions: {
ecmaVersion: "latest",
sourceType: "commonjs",
globals: {
process: "readonly",
__dirname: "readonly",
__filename: "readonly",
require: "readonly",
module: "readonly",
exports: "writable",
console: "readonly",
Buffer: "readonly",
URLSearchParams: "readonly"
}
},
rules: {
// Possible Errors
"comma-dangle": ["error", "never"],
"getter-return": "error",
"no-async-promise-executor": "error",
"no-await-in-loop": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-console": "error",
"no-constant-condition": "error",
"no-control-regex": "error",
"no-debugger": "error",
"no-dupe-args": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty-character-class": "error",
"no-empty": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-extra-parens": "off",
"no-extra-semi": "error",
"no-func-assign": "error",
"no-inner-declarations": ["error", "functions"],
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-obj-calls": "error",
"no-regex-spaces": "error",
"no-sparse-arrays": "off",
"no-unreachable": "error",
"use-isnan": "error",
"valid-typeof": "error",
"no-unexpected-multiline": "error",
// Best Practices
"accessor-pairs": "error",
"block-scoped-var": "off",
"complexity": ["warn", 9],
"consistent-return": "warn",
"curly": ["error", "all"],
"default-case": "off",
"dot-notation": "error",
"dot-location": ["error", "property"],
"eqeqeq": "error",
"guard-for-in": "error",
"no-alert": "error",
"no-caller": "error",
"no-div-regex": "error",
"no-else-return": "error",
"no-eq-null": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-fallthrough": "error",
"no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-implied-eval": "error",
"no-invalid-this": "error",
"no-iterator": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-loop-func": "error",
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"no-multi-str": "error",
"no-new-func": "error",
"no-new-wrappers": "error",
"no-new": "error",
"no-octal-escape": "error",
"no-octal": "error",
"no-param-reassign": "error",
"no-proto": "error",
"no-redeclare": "error",
"no-return-assign": "error",
"no-return-await": "error",
"no-script-url": "error",
"no-self-assign": "error",
"no-self-compare": "error",
"no-sequences": "error",
"no-throw-literal": "error",
"no-unused-expressions": "off",
"no-useless-call": "error",
"no-void": "error",
"no-warning-comments": "off",
"no-with": "error",
"radix": "error",
"vars-on-top": "error",
"wrap-iife": "error",
"yoda": "error",
// Variables
"init-declarations": "off",
"no-delete-var": "error",
"no-label-var": "error",
"no-shadow-restricted-names": "error",
"no-shadow": "error",
"no-undef-init": "error",
"no-undef": "error",
"no-undefined": "off",
"no-unused-vars": "error",
"no-use-before-define": "error",
// Node.js (using stylistic rules where available in ESLint 9)
"callback-return": "off", // Removed in ESLint 9
"global-require": "off", // Removed in ESLint 9
"handle-callback-err": "off", // Removed in ESLint 9
"no-mixed-requires": "off", // Removed in ESLint 9
"no-new-require": "off", // Removed in ESLint 9
"no-path-concat": "off", // Removed in ESLint 9
"no-process-env": "off", // Removed in ESLint 9
"no-process-exit": "off", // Removed in ESLint 9
"no-restricted-modules": "off",
"no-sync": "off", // Removed in ESLint 9
"no-buffer-constructor": "error",
// Stylistic Issues (many moved to @stylistic/eslint-plugin in ESLint 9)
"array-bracket-spacing": "off",
"brace-style": "off",
"camelcase": "error",
"comma-spacing": "off",
"comma-style": "off",
"computed-property-spacing": "off",
"consistent-this": "off",
"eol-last": "off",
"func-names": "off",
"func-style": "off",
"id-length": ["error", { "min": 2, "max": 70, "exceptions": ["i", "j", "k", "n", "Q", "_"] }],
"id-match": "off",
"indent": "off",
"key-spacing": "off",
"lines-around-comment": "off",
"linebreak-style": "off",
"max-nested-callbacks": ["error", 6],
"max-statements-per-line": "off",
"new-cap": "off",
"new-parens": "off",
"newline-after-var": "off",
"no-array-constructor": "error",
"no-continue": "error",
"no-inline-comments": "off",
"no-lonely-if": "error",
"no-mixed-spaces-and-tabs": "error",
"no-multiple-empty-lines": "off",
"no-nested-ternary": "error",
"no-new-object": "error",
"no-spaced-func": "off",
"no-ternary": "off",
"no-trailing-spaces": "off",
"no-underscore-dangle": "off",
"no-unneeded-ternary": "error",
"object-curly-spacing": "off",
"one-var": ["warn", "never"],
"operator-assignment": ["error", "always"],
"operator-linebreak": "off",
"padded-blocks": "off",
"quote-props": "off",
"quotes": "off",
"semi-spacing": "off",
"semi": "off",
"sort-vars": "off",
"keyword-spacing": "off",
"space-before-blocks": "off",
"space-before-function-paren": "off",
"space-in-parens": "off",
"space-infix-ops": "off",
"space-unary-ops": "off",
"spaced-comment": "off",
"wrap-regex": "off",
// ECMAScript 6
"arrow-parens": "off",
"arrow-spacing": "off",
"constructor-super": "error",
"generator-star-spacing": "off",
"no-class-assign": "error",
"no-const-assign": "error",
"no-this-before-super": "error",
"no-var": "error",
"object-shorthand": ["error", "methods"],
"prefer-const": "error",
"prefer-spread": "error",
"require-yield": "error",
"prefer-template": "error"
}
}
];