@akinon/eslint-plugin-projectzero 1.59.0 → 1.60.0-rc.6
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/CHANGELOG.md +23 -0
- package/dist/rules/case-warning.js +32 -0
- package/package.json +1 -1
- package/rules/case-warning.ts +39 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @akinon/eslint-plugin-projectzero
|
|
2
2
|
|
|
3
|
+
## 1.60.0-rc.6
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5a4c6076: ZERO-2764: Add case-warning rule to eslint-plugin-projectzero
|
|
8
|
+
- 64699d3f: ZERO-2761: Fix invalid import for plugin module
|
|
9
|
+
|
|
3
10
|
## 1.59.0
|
|
4
11
|
|
|
5
12
|
## 1.58.0
|
|
@@ -11,6 +18,22 @@
|
|
|
11
18
|
### Minor Changes
|
|
12
19
|
|
|
13
20
|
- 4d64ef7: ZERO-2611: Add check-sentry-options rule to eslint-plugin-projectzero
|
|
21
|
+
- 5a4c6076: ZERO-2764: Add case-warning rule to eslint-plugin-projectzero
|
|
22
|
+
- 64699d3: ZERO-2761: Fix invalid import for plugin module
|
|
23
|
+
|
|
24
|
+
## 1.56.0-rc.3
|
|
25
|
+
|
|
26
|
+
## 1.56.0-rc.2
|
|
27
|
+
|
|
28
|
+
## 1.56.0-rc.1
|
|
29
|
+
|
|
30
|
+
## 1.56.0-rc.0
|
|
31
|
+
|
|
32
|
+
### Minor Changes
|
|
33
|
+
|
|
34
|
+
- 4d64ef7e: ZERO-2611: Add check-sentry-options rule to eslint-plugin-projectzero
|
|
35
|
+
- 5a4c6076: ZERO-2764: Add case-warning rule to eslint-plugin-projectzero
|
|
36
|
+
- 64699d3f: ZERO-2761: Fix invalid import for plugin module
|
|
14
37
|
|
|
15
38
|
## 1.55.0
|
|
16
39
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("@typescript-eslint/utils");
|
|
4
|
+
exports.default = utils_1.ESLintUtils.RuleCreator.withoutDocs({
|
|
5
|
+
create(context) {
|
|
6
|
+
return {
|
|
7
|
+
CallExpression(node) {
|
|
8
|
+
if (node.callee.type === 'MemberExpression' &&
|
|
9
|
+
node.callee.property.type === 'Identifier' &&
|
|
10
|
+
(node.callee.property.name === 'toLocaleUpperCase' ||
|
|
11
|
+
node.callee.property.name === 'toLocaleLowerCase')) {
|
|
12
|
+
const args = node.arguments;
|
|
13
|
+
if (args.length === 0) {
|
|
14
|
+
context.report({
|
|
15
|
+
node,
|
|
16
|
+
messageId: 'noLocale'
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
meta: {
|
|
24
|
+
messages: {
|
|
25
|
+
noLocale: 'toLocaleUpperCase() or toLocaleLowerCase() should specify a locale for consistent behavior across different environments.'
|
|
26
|
+
},
|
|
27
|
+
type: 'problem',
|
|
28
|
+
fixable: 'code',
|
|
29
|
+
schema: []
|
|
30
|
+
},
|
|
31
|
+
defaultOptions: []
|
|
32
|
+
});
|
package/package.json
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ESLintUtils } from '@typescript-eslint/utils';
|
|
2
|
+
import { TSESTree } from '@typescript-eslint/types';
|
|
3
|
+
|
|
4
|
+
type MessageIds = 'noLocale';
|
|
5
|
+
type Options = readonly [];
|
|
6
|
+
|
|
7
|
+
export default ESLintUtils.RuleCreator.withoutDocs<Options, MessageIds>({
|
|
8
|
+
create(context) {
|
|
9
|
+
return {
|
|
10
|
+
CallExpression(node: TSESTree.CallExpression) {
|
|
11
|
+
if (
|
|
12
|
+
node.callee.type === 'MemberExpression' &&
|
|
13
|
+
node.callee.property.type === 'Identifier' &&
|
|
14
|
+
(node.callee.property.name === 'toLocaleUpperCase' ||
|
|
15
|
+
node.callee.property.name === 'toLocaleLowerCase')
|
|
16
|
+
) {
|
|
17
|
+
const args = node.arguments;
|
|
18
|
+
|
|
19
|
+
if (args.length === 0) {
|
|
20
|
+
context.report({
|
|
21
|
+
node,
|
|
22
|
+
messageId: 'noLocale'
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
meta: {
|
|
30
|
+
messages: {
|
|
31
|
+
noLocale:
|
|
32
|
+
'toLocaleUpperCase() or toLocaleLowerCase() should specify a locale for consistent behavior across different environments.'
|
|
33
|
+
},
|
|
34
|
+
type: 'problem',
|
|
35
|
+
fixable: 'code',
|
|
36
|
+
schema: []
|
|
37
|
+
},
|
|
38
|
+
defaultOptions: []
|
|
39
|
+
});
|