UNPKG

ulint-config-js

Version:

JavaScript ESLint configuration preset for uLint — includes recommended and strict rules for modern JavaScript projects.

138 lines (137 loc) 3.85 kB
import e from "@eslint/js"; import { defineConfig as o } from "eslint/config"; import n from "eslint-config-prettier"; import s from "eslint-plugin-import"; import t from "eslint-plugin-prettier"; import a from "eslint-plugin-promise"; import i from "eslint-plugin-safeguard"; import m from "eslint-plugin-security"; import l from "eslint-plugin-simple-import-sort"; import p from "eslint-plugin-sort-keys-fix"; import u from "eslint-plugin-unused-imports"; import r from "globals"; const I = o([ m.configs.recommended, s.flatConfigs.recommended, e.configs.recommended, n, a.configs["flat/recommended"], { ignores: ["**/node_modules/**", "**/dist/**", "**/temp/**", "**/tpm/**"] }, { languageOptions: { ecmaVersion: "latest", globals: { ...r.browser, ...r.node, ...r.es2025 }, parserOptions: { ecmaVersion: "latest", sourceType: "module" }, sourceType: "module" }, name: "ulint/javascript", plugins: { prettier: t, safeguard: i, "simple-import-sort": l, "sort-keys-fix": p, "unused-imports": u }, rules: { "arrow-body-style": ["warn", "as-needed"], "consistent-return": "error", eqeqeq: "error", "import/no-cycle": [ "error", { allowUnsafeDynamicCyclicDependency: !1, ignoreExternal: !0, maxDepth: 2 } ], "import/no-unresolved": "error", "max-len": ["off", { code: 80 }], "no-await-in-loop": "warn", "no-console": "warn", "no-debugger": "warn", "no-duplicate-imports": "error", "no-else-return": "error", "no-eval": "error", "no-extend-native": "error", "no-implicit-coercion": "warn", "no-labels": "error", "no-lonely-if": "warn", "no-nested-ternary": "warn", "no-new-func": "error", "no-param-reassign": ["warn", { props: !0 }], "no-plusplus": "warn", "no-redeclare": "error", "no-restricted-imports": [ "error", { patterns: [ { group: ["**/../*"], message: "Use absolute imports with @alias aliases instead" } ] } ], "no-return-await": "error", "no-shadow": "error", "no-undef": "error", "no-unreachable": "error", "no-unused-labels": "error", "no-useless-constructor": "warn", "no-var": "error", "object-shorthand": "error", "padding-line-between-statements": [ "warn", { blankLine: "always", next: "return", prev: "block" }, { blankLine: "always", next: "return", prev: "const" }, { blankLine: "always", next: "function", prev: "*" } ], "prefer-arrow-callback": "error", "prefer-destructuring": [ "warn", { array: !1, object: !0 } ], "prefer-template": "error", "prettier/prettier": "error", "promise/always-return": "error", "promise/catch-or-return": "error", "safeguard/no-raw-error": "warn", "safeguard/no-self-assignments": "error", "safeguard/trycatch-ensurer": "off", "simple-import-sort/exports": "error", "simple-import-sort/imports": "error", "sort-keys": "off", "sort-keys-fix/sort-keys-fix": [ "warn", "asc", { caseSensitive: !1, natural: !0 } ], "spaced-comment": ["warn", "always"], "unused-imports/no-unused-imports": "error", "unused-imports/no-unused-vars": [ "warn", { args: "after-used", argsIgnorePattern: "^_", vars: "all", varsIgnorePattern: "^_" } ] }, settings: { "import/resolver": { node: !0 } } } ]); export { I as default };