|
@@ -113,7 +113,7 @@ module.exports = {
|
|
|
return {
|
|
|
BinaryExpression: function (node) {
|
|
|
if (
|
|
|
- node.operator === '===' && (
|
|
|
+ (node.operator === '===' || node.operator === '!==') && (
|
|
|
(node.right.type === 'Literal' && node.left.type === 'Literal') ||
|
|
|
(node.right.type === 'Literal' && ![true, false].includes(node.right.value)) ||
|
|
|
(node.left.type === 'Literal' && ![true, false].includes(node.left.value)) ||
|
|
@@ -122,7 +122,7 @@ module.exports = {
|
|
|
) {
|
|
|
context.report({
|
|
|
node: node,
|
|
|
- message: 'Avoid using strict equality operator \'===\' (use loose equality operator \'==\' instead)',
|
|
|
+ message: 'Avoid using strict equality operator \''+node.operator+'\' (use loose equality operator \''+node.operator.substring(0, 2)+'\' instead)',
|
|
|
});
|
|
|
}
|
|
|
},
|
|
@@ -287,7 +287,7 @@ module.exports = {
|
|
|
* ],
|
|
|
* 'rules': {
|
|
|
* 'z8/no-spaces-in-control-flow-statements': ['error'],
|
|
|
- * 'z8/no-strict-equality': ['warn'], // error?
|
|
|
+ * 'z8/no-strict-equality': ['error'],
|
|
|
* 'z8/no-double-quotes': ['error'],
|
|
|
* 'z8/no-arrow-functions': ['error'],
|
|
|
* 'z8/no-function-declaration': ['error'],
|
|
@@ -304,7 +304,8 @@ module.exports = {
|
|
|
* 'z8/whitespace-only-lines': ['error']
|
|
|
* },
|
|
|
* 'parserOptions': {
|
|
|
- * 'ecmaVersion': 2022
|
|
|
+ * 'ecmaVersion': 2022,
|
|
|
+ * 'sourceType': 'module'
|
|
|
* }
|
|
|
* }
|
|
|
*
|