default-config.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * @fileoverview Default configuration
  3. * @author Nicholas C. Zakas
  4. */
  5. "use strict";
  6. //-----------------------------------------------------------------------------
  7. // Requirements
  8. //-----------------------------------------------------------------------------
  9. const Rules = require("../rules");
  10. //-----------------------------------------------------------------------------
  11. // Helpers
  12. //-----------------------------------------------------------------------------
  13. exports.defaultConfig = Object.freeze([
  14. {
  15. plugins: {
  16. "@": {
  17. languages: {
  18. js: require("../languages/js")
  19. },
  20. /*
  21. * Because we try to delay loading rules until absolutely
  22. * necessary, a proxy allows us to hook into the lazy-loading
  23. * aspect of the rules map while still keeping all of the
  24. * relevant configuration inside of the config array.
  25. */
  26. rules: new Proxy({}, {
  27. get(target, property) {
  28. return Rules.get(property);
  29. },
  30. has(target, property) {
  31. return Rules.has(property);
  32. }
  33. })
  34. }
  35. },
  36. language: "@/js",
  37. linterOptions: {
  38. reportUnusedDisableDirectives: 1
  39. }
  40. },
  41. // default ignores are listed here
  42. {
  43. ignores: [
  44. "**/node_modules/",
  45. ".git/"
  46. ]
  47. },
  48. // intentionally empty config to ensure these files are globbed by default
  49. {
  50. files: ["**/*.js", "**/*.mjs"]
  51. },
  52. {
  53. files: ["**/*.cjs"],
  54. languageOptions: {
  55. sourceType: "commonjs",
  56. ecmaVersion: "latest"
  57. }
  58. }
  59. ]);