Skip to content

Commit 73eac72

Browse files
mdjermanovicljharb
authored andcommitted
[Tests] test plugin in flat configs
1 parent 6caa1ac commit 73eac72

File tree

17 files changed

+251
-1
lines changed

17 files changed

+251
-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');
4+
5+
module.exports = [{
6+
files: ['**/*.jsx'],
7+
...reactAll,
8+
languageOptions: {
9+
...reactAll.languageOptions
10+
}
11+
}];
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
const reactPlugin = require('../../../..');
4+
5+
module.exports = [{
6+
files: ['**/*.jsx'],
7+
...reactPlugin.configs['flat/all']
8+
}];
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');
4+
const reactJSXRuntime = require('../../../../configs/jsx-runtime');
5+
6+
module.exports = [
7+
{
8+
files: ['**/*.jsx'],
9+
...reactRecommended,
10+
languageOptions: {
11+
...reactRecommended.languageOptions
12+
}
13+
},
14+
reactJSXRuntime
15+
];
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
'use strict';
2+
3+
const reactPlugin = require('../../../..');
4+
5+
module.exports = [
6+
{
7+
files: ['**/*.jsx'],
8+
...reactPlugin.configs['flat/recommended']
9+
},
10+
reactPlugin.configs['flat/jsx-runtime']
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: 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');
4+
5+
module.exports = [{
6+
files: ['**/*.jsx'],
7+
...reactRecommended,
8+
languageOptions: {
9+
...reactRecommended.languageOptions
10+
}
11+
}];
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
'use strict';
2+
3+
const reactPlugin = require('../../../..');
4+
5+
module.exports = [{
6+
files: ['**/*.jsx'],
7+
...reactPlugin.configs['flat/recommended']
8+
}];

0 commit comments

Comments
 (0)