2
0

eslint.config.mjs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import globals from "globals";
  2. import js from "@eslint/js";
  3. export default [
  4. js.configs.recommended,
  5. {
  6. files: ["**/*.js"],
  7. rules: {
  8. "camelcase": ["off", {"properties": "always"}],
  9. "comma-spacing": ["error", {"before": false, "after": true}],
  10. "curly": ["error", "all"],
  11. "dot-notation": ["error", {"allowKeywords": true}],
  12. "eqeqeq": ["error"],
  13. "indent": ["error", 4],
  14. "key-spacing": ["error", {"beforeColon": false, "afterColon": true}],
  15. "linebreak-style": ["error", "unix"],
  16. "new-cap": ["off", {"newIsCap": true, "capIsNew": true}],
  17. "no-alert": ["off"],
  18. "no-eval": ["error"],
  19. "no-extend-native": ["error", {"exceptions": ["Date", "String"]}],
  20. "no-multi-spaces": ["error"],
  21. "no-octal-escape": ["error"],
  22. "no-script-url": ["error"],
  23. "no-shadow": ["error", {"hoist": "functions"}],
  24. "no-underscore-dangle": ["error"],
  25. "no-unused-vars": ["error", {"vars": "local", "args": "none"}],
  26. "no-var": ["error"],
  27. "prefer-const": ["error"],
  28. "quotes": ["off", "single"],
  29. "semi": ["error", "always"],
  30. "space-before-blocks": ["error", "always"],
  31. "space-before-function-paren": ["error", {"anonymous": "never", "named": "never"}],
  32. "space-infix-ops": ["error", {"int32Hint": false}],
  33. "strict": ["error", "global"]
  34. },
  35. languageOptions: {
  36. ecmaVersion: 6,
  37. sourceType: "script",
  38. globals: {
  39. ...globals.browser,
  40. ...globals.commonjs,
  41. "django": false
  42. }
  43. }
  44. },
  45. {
  46. files: ["**/*.mjs"],
  47. languageOptions: {
  48. sourceType: "module"
  49. }
  50. },
  51. {
  52. ignores: [
  53. "**/*.min.js",
  54. "**/vendor/**/*.js",
  55. "django/contrib/gis/templates/**/*.js",
  56. "django/views/templates/*.js",
  57. "docs/_build/**/*.js",
  58. "node_modules/**.js",
  59. "tests/**/*.js",
  60. ]
  61. }
  62. ];