eslint-plugin-unicorn 44.0.0 → 44.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/package.json
CHANGED
|
@@ -31,11 +31,21 @@ const ignored = [
|
|
|
31
31
|
'underscore.find',
|
|
32
32
|
'R.find',
|
|
33
33
|
|
|
34
|
+
'lodash.findLast',
|
|
35
|
+
'_.findLast',
|
|
36
|
+
'underscore.findLast',
|
|
37
|
+
'R.findLast',
|
|
38
|
+
|
|
34
39
|
'lodash.findIndex',
|
|
35
40
|
'_.findIndex',
|
|
36
41
|
'underscore.findIndex',
|
|
37
42
|
'R.findIndex',
|
|
38
43
|
|
|
44
|
+
'lodash.findLastIndex',
|
|
45
|
+
'_.findLastIndex',
|
|
46
|
+
'underscore.findLastIndex',
|
|
47
|
+
'R.findLastIndex',
|
|
48
|
+
|
|
39
49
|
'lodash.flatMap',
|
|
40
50
|
'_.flatMap',
|
|
41
51
|
|
|
@@ -38,10 +38,11 @@ const isIdentifierNamed = ({type, name}, expectName) => type === 'Identifier' &&
|
|
|
38
38
|
function simpleArraySearchRule({method, replacement}) {
|
|
39
39
|
// Add prefix to avoid conflicts in `prefer-includes` rule
|
|
40
40
|
const MESSAGE_ID_PREFIX = `prefer-${replacement}-over-${method}/`;
|
|
41
|
-
const ERROR = `${MESSAGE_ID_PREFIX}
|
|
42
|
-
const SUGGESTION = `${MESSAGE_ID_PREFIX}
|
|
41
|
+
const ERROR = `${MESSAGE_ID_PREFIX}error`;
|
|
42
|
+
const SUGGESTION = `${MESSAGE_ID_PREFIX}suggestion`;
|
|
43
43
|
const ERROR_MESSAGES = {
|
|
44
44
|
findIndex: 'Use `.indexOf()` instead of `.findIndex()` when looking for the index of an item.',
|
|
45
|
+
findLastIndex: 'Use `.lastIndexOf()` instead of `findLastIndex() when looking for the index of an item.`',
|
|
45
46
|
some: `Use \`.${replacement}()\` instead of \`.${method}()\` when checking value existence.`,
|
|
46
47
|
};
|
|
47
48
|
|