eslintrc-incompat.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. "use strict";
  2. /* eslint consistent-return: 0 -- no default case */
  3. const messages = {
  4. env: `
  5. A config object is using the "env" key, which is not supported in flat config system.
  6. Flat config uses "languageOptions.globals" to define global variables for your files.
  7. Please see the following page for information on how to convert your config object into the correct format:
  8. https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
  9. If you're not using "env" directly (it may be coming from a plugin), please see the following:
  10. https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
  11. `,
  12. extends: `
  13. A config object is using the "extends" key, which is not supported in flat config system.
  14. Instead of "extends", you can include config objects that you'd like to extend from directly in the flat config array.
  15. If you're using "extends" in your config file, please see the following:
  16. https://eslint.org/docs/latest/use/configure/migration-guide#predefined-and-shareable-configs
  17. If you're not using "extends" directly (it may be coming from a plugin), please see the following:
  18. https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
  19. `,
  20. globals: `
  21. A config object is using the "globals" key, which is not supported in flat config system.
  22. Flat config uses "languageOptions.globals" to define global variables for your files.
  23. Please see the following page for information on how to convert your config object into the correct format:
  24. https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
  25. If you're not using "globals" directly (it may be coming from a plugin), please see the following:
  26. https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
  27. `,
  28. ignorePatterns: `
  29. A config object is using the "ignorePatterns" key, which is not supported in flat config system.
  30. Flat config uses "ignores" to specify files to ignore.
  31. Please see the following page for information on how to convert your config object into the correct format:
  32. https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
  33. If you're not using "ignorePatterns" directly (it may be coming from a plugin), please see the following:
  34. https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
  35. `,
  36. noInlineConfig: `
  37. A config object is using the "noInlineConfig" key, which is not supported in flat config system.
  38. Flat config uses "linterOptions.noInlineConfig" to specify files to ignore.
  39. Please see the following page for information on how to convert your config object into the correct format:
  40. https://eslint.org/docs/latest/use/configure/migration-guide#linter-options
  41. `,
  42. overrides: `
  43. A config object is using the "overrides" key, which is not supported in flat config system.
  44. Flat config is an array that acts like the eslintrc "overrides" array.
  45. Please see the following page for information on how to convert your config object into the correct format:
  46. https://eslint.org/docs/latest/use/configure/migration-guide#glob-based-configs
  47. If you're not using "overrides" directly (it may be coming from a plugin), please see the following:
  48. https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
  49. `,
  50. parser: `
  51. A config object is using the "parser" key, which is not supported in flat config system.
  52. Flat config uses "languageOptions.parser" to override the default parser.
  53. Please see the following page for information on how to convert your config object into the correct format:
  54. https://eslint.org/docs/latest/use/configure/migration-guide#custom-parsers
  55. If you're not using "parser" directly (it may be coming from a plugin), please see the following:
  56. https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
  57. `,
  58. parserOptions: `
  59. A config object is using the "parserOptions" key, which is not supported in flat config system.
  60. Flat config uses "languageOptions.parserOptions" to specify parser options.
  61. Please see the following page for information on how to convert your config object into the correct format:
  62. https://eslint.org/docs/latest/use/configure/migration-guide#configuring-language-options
  63. If you're not using "parserOptions" directly (it may be coming from a plugin), please see the following:
  64. https://eslint.org/docs/latest/use/configure/migration-guide#using-eslintrc-configs-in-flat-config
  65. `,
  66. reportUnusedDisableDirectives: `
  67. A config object is using the "reportUnusedDisableDirectives" key, which is not supported in flat config system.
  68. Flat config uses "linterOptions.reportUnusedDisableDirectives" to specify files to ignore.
  69. Please see the following page for information on how to convert your config object into the correct format:
  70. https://eslint.org/docs/latest/use/configure/migration-guide#linter-options
  71. `,
  72. root: `
  73. A config object is using the "root" key, which is not supported in flat config system.
  74. Flat configs always act as if they are the root config file, so this key can be safely removed.
  75. `
  76. };
  77. module.exports = function({ key }) {
  78. return messages[key].trim();
  79. };