default-config.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 = [
  14. {
  15. plugins: {
  16. "@": {
  17. parsers: {
  18. espree: require("espree")
  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. languageOptions: {
  37. sourceType: "module",
  38. ecmaVersion: "latest",
  39. parser: "@/espree",
  40. parserOptions: {}
  41. }
  42. },
  43. // default ignores are listed here
  44. {
  45. ignores: [
  46. "**/node_modules/*",
  47. ".git/"
  48. ]
  49. },
  50. // intentionally empty config to ensure these files are globbed by default
  51. {
  52. files: ["**/*.js", "**/*.mjs"]
  53. },
  54. {
  55. files: ["**/*.cjs"],
  56. languageOptions: {
  57. sourceType: "commonjs",
  58. ecmaVersion: "latest"
  59. }
  60. }
  61. ];