-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrecommended-jsx.js
More file actions
33 lines (30 loc) · 804 Bytes
/
recommended-jsx.js
File metadata and controls
33 lines (30 loc) · 804 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
const jsxA11y = require('eslint-plugin-jsx-a11y')
const neostandard = require('neostandard')
// Run neostandard's config builder function and then grab just the JSX configs
// from the returned config array.
const configNames = ['neostandard/jsx', 'neostandard/style/jsx']
const neostandardJsxConfigs = neostandard().reduce((acc, config) => {
if (configNames.includes(config.name)) {
acc.push({
...config,
// JSX configs should apply for all files, including .js and .ts files.
ignores: []
})
}
return acc
}, [])
module.exports = [
{
files: ['**/*.jsx']
},
jsxA11y.flatConfigs.strict,
...neostandardJsxConfigs,
{
rules: {
//
// @stylistic/eslint-plugin rules.
//
'@stylistic/jsx-quotes': ['error', 'prefer-double']
}
}
]