-
Notifications
You must be signed in to change notification settings - Fork 4
/
react-jsx-no-literals.js
33 lines (31 loc) · 1.06 KB
/
react-jsx-no-literals.js
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
/* eslint sort-keys: ["error", "asc"] */
/* eslint-disable sort-keys */
const globPatterns = require("../glob-patterns.js");
module.exports = {
rules: {
/* eslint-enable sort-keys */
// If we don't adjust this rule, it would autofix the escape hatch
// {"some string"} allowed by "jsx-no-literals"
"react/jsx-curly-brace-presence": [
"warn",
{
children: "always",
props: "never",
},
],
"react/jsx-no-literals": "warn", // https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
/* eslint-disable sort-keys */
},
overrides: [
{
files: globPatterns.tests,
rules: {
/* eslint-enable sort-keys */
// It's quite common in tests to use example strings
"react/jsx-curly-brace-presence": ["warn", "never"],
"react/jsx-no-literals": "off",
/* eslint-disable sort-keys */
},
},
],
};