@markof/eslint-plugin-no-chinese 1.0.2 → 1.0.4

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
@@ -11,7 +11,7 @@ Add '@markof/eslint-plugin-no-chinese' to plugins in .eslintrc file.
11
11
  ```javascript
12
12
  {
13
13
  "plugins": [
14
- "@markof/eslint-plugin-no-chinese"
14
+ "@markof/no-chinese"
15
15
  ]
16
16
  }
17
17
  ```
@@ -20,9 +20,9 @@ Config rules in .eslintrc file.
20
20
  ```javascript
21
21
  {
22
22
  "rules": {
23
- "@markof/eslint-plugin-no-chinese/no-chinese-code": "error",
24
- "@markof/eslint-plugin-no-chinese/no-chinese-comment": "error",
25
- "@markof/eslint-plugin-no-chinese/no-chinese-console": "error",
23
+ "@markof/no-chinese/no-chinese-code": "error",
24
+ "@markof/no-chinese/no-chinese-comment": "error",
25
+ "@markof/no-chinese/no-chinese-console": "error",
26
26
  }
27
27
  }
28
28
  ```
package/lib/index.js CHANGED
@@ -5,17 +5,22 @@ const plugin = {
5
5
  name: pkg.name,
6
6
  version: pkg.version,
7
7
  },
8
- configs: {},
9
8
  rules: {
10
9
  "no-chinese-code": require('./rules/no-chinese-code.js'),
11
10
  "no-chinese-comment": require('./rules/no-chinese-comment.js'),
12
11
  "no-chinese-console": require('./rules/no-chinese-console.js'),
13
12
  },
14
- processors: {}
13
+ configs: {
14
+ recommended: {
15
+ plugins: [pkg.name],
16
+ rules: {
17
+ [pkg.name + '/no-chinese-code']: 'error',
18
+ [pkg.name + '/no-chinese-comment']: 'error',
19
+ [pkg.name + '/no-chinese-console']: 'error',
20
+ },
21
+ },
22
+ }
15
23
  }
16
24
 
17
- // for ESM
18
- export default plugin;
19
-
20
25
  // OR for CommonJS
21
26
  module.exports = plugin;
package/package.json CHANGED
@@ -1,8 +1,12 @@
1
1
  {
2
2
  "name": "@markof/eslint-plugin-no-chinese",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "eslint plugin to forbid chinese",
5
- "keywords": ["eslint", "eslint-plugin", "chinese"],
5
+ "keywords": [
6
+ "eslint",
7
+ "eslint-plugin",
8
+ "chinese"
9
+ ],
6
10
  "repository": "https://github.com/markof/eslint-plugin-no-chinese",
7
11
  "author": "Markof",
8
12
  "main": "lib/index.js",
@@ -11,7 +15,9 @@
11
15
  "test": "mocha tests --recursive"
12
16
  },
13
17
  "dependencies": {
14
- "requireindex": "^1.2.0"
18
+ "@eslint/js": "^9.15.0",
19
+ "requireindex": "^1.2.0",
20
+ "typescript-eslint": "^8.15.0"
15
21
  },
16
22
  "devDependencies": {
17
23
  "eslint": "^8.0.1",
package/tests/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const RuleTester = require("eslint").RuleTester
2
2
  var ruleTester = new RuleTester()
3
3
  const ruleNoChineseCode = require("../lib/rules/no-chinese-code")
4
- const ruleNoChineseComments = require("../lib/rules/no-chinese-comments")
4
+ const ruleNoChineseComments = require("../lib/rules/no-chinese-comment")
5
5
  const ruleNoChineseConsole = require("../lib/rules/no-chinese-console")
6
6
 
7
7
  ruleTester.run("no-chinese-code", ruleNoChineseCode, {
@@ -34,7 +34,7 @@ ruleTester.run("no-chinese-console", ruleNoChineseConsole, {
34
34
  ],
35
35
  })
36
36
 
37
- ruleTester.run("no-chinese-comments", ruleNoChineseComments, {
37
+ ruleTester.run("no-chinese-comment", ruleNoChineseComments, {
38
38
  valid: [`// this is a comment`, `/* this is a comment */`],
39
39
  invalid: [
40
40
  {