Skip to content

Commit 740bf7c

Browse files
committed
[Tests] test plugin in flat configs
1 parent 31ef12a commit 740bf7c

File tree

13 files changed

+201
-1
lines changed

13 files changed

+201
-1
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"ignorePatterns": [
1717
"coverage/",
1818
".nyc_output/",
19+
"tests/fixtures/flat-config/"
1920
],
2021
"rules": {
2122
"comma-dangle": [2, "always-multiline"],

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test": "npm run unit-test",
1616
"posttest": "aud --production",
1717
"type-check": "tsc",
18-
"unit-test": "istanbul cover node_modules/mocha/bin/_mocha tests/lib/**/*.js tests/util/**/*.js tests/index.js",
18+
"unit-test": "istanbul cover node_modules/mocha/bin/_mocha tests/lib/**/*.js tests/util/**/*.js tests/index.js tests/flat-config.js",
1919
"update:eslint-docs": "eslint-doc-generator"
2020
},
2121
"repository": {
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
const reactAll = require('../../../../configs/all.js');
4+
5+
module.exports = [{
6+
files: ['**/*.jsx'],
7+
...reactAll,
8+
languageOptions: {
9+
...reactAll.languageOptions
10+
}
11+
}];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div foo="hello">
2+
test
3+
</div>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
const reactRecommended = require('../../../../configs/recommended.js');
4+
const reactJSXRuntime = require('../../../../configs/jsx-runtime.js');
5+
6+
module.exports = [
7+
{
8+
files: ['**/*.jsx'],
9+
...reactRecommended,
10+
languageOptions: {
11+
...reactRecommended.languageOptions
12+
}
13+
},
14+
reactJSXRuntime
15+
];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div foo="hello">
2+
test
3+
</div>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
const reactRecommended = require('../../../../configs/recommended.js');
4+
5+
module.exports = [{
6+
files: ['**/*.jsx'],
7+
...reactRecommended,
8+
languageOptions: {
9+
...reactRecommended.languageOptions
10+
}
11+
}];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div foo="hello">
2+
test
3+
</div>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
'use strict';
2+
3+
const react = require('../../../..');
4+
const reactRecommended = require('../../../../configs/recommended.js');
5+
6+
module.exports = [
7+
{
8+
files: ['**/*.jsx'],
9+
plugins: { react }
10+
},
11+
{
12+
files: ['**/*.jsx'],
13+
...reactRecommended,
14+
languageOptions: {
15+
...reactRecommended.languageOptions
16+
}
17+
}
18+
];
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div foo="hello">
2+
test
3+
</div>

0 commit comments

Comments
 (0)