-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.js
More file actions
35 lines (33 loc) · 888 Bytes
/
eslint.config.js
File metadata and controls
35 lines (33 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// eslint.config.js
'use strict';
const pluginJs = require("@eslint/js");
const reactPlugin = require('eslint-plugin-react');
const globals = require('globals');
const prettierConfig = require('eslint-config-prettier');
module.exports = [
pluginJs.configs.recommended,
reactPlugin.configs.flat.recommended, // This is not a plugin object, but a shareable config object
reactPlugin.configs.flat['jsx-runtime'], // Add this if you are using React 17+
{
plugins: {
js: pluginJs,
react: reactPlugin,
}
},
{
files: ["src/**/*.js"],
settings: {
react: {
version: "detect",
},
},
languageOptions: {
...reactPlugin.configs.flat.recommended.languageOptions,
globals: {
...globals.serviceworker,
...globals.browser,
},
},
},
prettierConfig, // Must be last to override other configs
];