UNPKG

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