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