eslint.config.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import globals from "globals";
  2. import js from "@eslint/js";
  3. import neostandard, { resolveIgnoresFromGitignore } from 'neostandard';
  4. import stylistic from '@stylistic/eslint-plugin';
  5. export default [
  6. {
  7. files: ["**/*.js"],
  8. languageOptions: {
  9. globals: {
  10. ...globals.browser,
  11. },
  12. sourceType: "script",
  13. },
  14. },
  15. {
  16. ignores: [
  17. ...resolveIgnoresFromGitignore(),
  18. "**/*.min.js",
  19. "extensions/",
  20. "p/scripts/vendor/",
  21. ],
  22. },
  23. js.configs.recommended,
  24. // stylistic.configs['recommended-flat'],
  25. ...neostandard(),
  26. {
  27. plugins: {
  28. "@stylistic": stylistic,
  29. },
  30. rules: {
  31. "camelcase": "off",
  32. "eqeqeq": "off",
  33. "no-empty": ["error", { "allowEmptyCatch": true }],
  34. "no-unused-vars": ["error", {
  35. "args": "none",
  36. "caughtErrors": "none",
  37. }],
  38. "object-shorthand": "off",
  39. "yoda": "off",
  40. "@stylistic/indent": ["warn", "tab", { "SwitchCase": 1 }],
  41. "@stylistic/linebreak-style": ["error", "unix"],
  42. "@stylistic/max-len": ["warn", 165],
  43. "@stylistic/no-tabs": "off",
  44. "@stylistic/quotes": ["off", "single", { "avoidEscape": true }],
  45. "@stylistic/quote-props": ["warn", "consistent"],
  46. "@stylistic/semi": ["warn", "always"],
  47. "@stylistic/space-before-function-paren": ["warn", {
  48. "anonymous": "always",
  49. "asyncArrow": "always",
  50. "named": "never",
  51. }],
  52. },
  53. },
  54. ];