eslint-plugin-raflint 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
Ce plugin eslint permet de détecter les écritures du style :
|
|
2
|
+
|
|
3
|
+
const obj = {
|
|
4
|
+
...(condition ? { prop: 'value' } : {}),
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const obj = {
|
|
8
|
+
...(condition && { prop: 'value' }),
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
qui devrait être écrites comme ça:
|
|
12
|
+
|
|
13
|
+
const condition = true;
|
|
14
|
+
const obj = {};
|
|
15
|
+
if (condition) obj.prop = value;
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const { RuleTester } = require('eslint');
|
|
2
|
-
const noConditionalObjectSpread = require('
|
|
2
|
+
const noConditionalObjectSpread = require('../rules/no-conditional-object-spread.js');
|
|
3
3
|
|
|
4
4
|
const ruleTester = new RuleTester({
|
|
5
|
-
"parser": `${__dirname}
|
|
5
|
+
"parser": `${__dirname}/../node_modules/@babel/eslint-parser`,
|
|
6
6
|
"parserOptions": {
|
|
7
7
|
"ecmaVersion": "latest",
|
|
8
8
|
"sourceType": "module",
|
|
File without changes
|