You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Write in your ESLint configurations: http://eslint.org/docs/user-guide/configuring#using-the-configuration-from-a-plugin
25
25
26
+
### Configs
27
+
28
+
-`plugin:mysticatea/es2018` ... Basic configuration for ES2018.
29
+
-`plugin:mysticatea/es2017` ... Basic configuration for ES2017.
30
+
-`plugin:mysticatea/es2016` ... Basic configuration for ES2016.
31
+
-`plugin:mysticatea/es2015` ... Basic configuration for ES2015.
32
+
-`plugin:mysticatea/es5` ... Basic configuration for ES5.
33
+
-`plugin:mysticatea/+modules` ... Additional configuration for ES modules.
34
+
-`plugin:mysticatea/+browser` ... Additional configuration for browser environment.
35
+
-`plugin:mysticatea/+node` ... Additional configuration for Node.js environment.
36
+
-`plugin:mysticatea/+eslint-plugin` ... Additional configuration for ESLint plugins. This includes `plugin:mysticatea/+node` setting.
37
+
38
+
#### Details
39
+
40
+
The main configurations `plugin:mysticatea/es*` does:
41
+
42
+
- detect bug-like code by ESLint rules.
43
+
- enforce whitespace style by Prettier.
44
+
- handle the `.ts` files as TypeScript then check by `typescript-eslint-parser` and `eslint-plugin-typescript`.
45
+
- handle the `.vue` files as Vue.js SFC then check by `vue-eslint-parser` and `eslint-plugin-vue`.
46
+
- handle the files in `test`/`tests` directory as `mocha`'s test code.
47
+
- handle the files in `scripts` directory as Node.js environment.
48
+
- handle the `.eslintrc.js` file as a Node.js script.
49
+
- handle the `webpack.config.js` file as a Node.js script.
50
+
- handle the `rollup.config.js` file as an ES module.
51
+
52
+
You can use combination of a main configuration and some additional configurations.
53
+
For examples:
54
+
55
+
##### For Node.js
56
+
57
+
```json
58
+
{
59
+
"extends": [
60
+
"plugin:mysticatea/es2015",
61
+
"plugin:mysticatea/+node"
62
+
]
63
+
}
64
+
```
65
+
66
+
> It handles `.js` files as scripts and `.mjs` files as modules.
67
+
68
+
##### For Browsers
69
+
70
+
```json
71
+
{
72
+
"extends": [
73
+
"plugin:mysticatea/es2015",
74
+
"plugin:mysticatea/+browser"
75
+
]
76
+
}
77
+
```
78
+
79
+
##### For Browsers with ES modules
80
+
81
+
```json
82
+
{
83
+
"extends": [
84
+
"plugin:mysticatea/es2015",
85
+
"plugin:mysticatea/+modules",
86
+
"plugin:mysticatea/+browser"
87
+
]
88
+
}
89
+
```
90
+
91
+
##### For ESLint plugins
92
+
93
+
```json
94
+
{
95
+
"extends": [
96
+
"plugin:mysticatea/es2015",
97
+
"plugin:mysticatea/+eslint-plugin"
98
+
]
99
+
}
100
+
```
101
+
26
102
### Rules
27
103
104
+
This plugin has some original rules and foreign rules.
105
+
106
+
#### Original rules
107
+
28
108
-[mysticatea/arrow-parens](docs/rules/arrow-parens.md) enforces parens of argument lists (excludes too redundant parens) (fixable).
29
109
-[mysticatea/block-scoped-var](docs/rules/block-scoped-var.md) handles variables which are declared by `var` declaration as block-scoped. It disallows redeclarations, uses from outside of the scope, shadowing.
30
110
-[mysticatea/no-instanceof-array](docs/rules/no-instanceof-array.md) disallows 'instanceof' for Array (fixable).
@@ -35,58 +115,27 @@ Write in your ESLint configurations: http://eslint.org/docs/user-guide/configuri
-[mysticatea/prefer-for-of](docs/rules/prefer-for-of.md) requires `for-of` statements instead of `Array#forEach` or something like (fixable).
37
117
38
-
###Example
118
+
#### Foreign rules
39
119
40
-
**.eslintrc.json**
120
+
- All `mysticatea/eslint-comments/*` rules are imported from [eslint-plugin-eslint-comments](https://www.npmjs.com/package/eslint-plugin-eslint-comments).
121
+
- All `mysticatea/eslint-plugin/*` rules are imported from [eslint-plugin-eslint-plugin](https://www.npmjs.com/package/eslint-plugin-eslint-plugin).
122
+
- All `mysticatea/node/*` rules are imported from [eslint-plugin-node](https://www.npmjs.com/package/eslint-plugin-node).
123
+
- All `mysticatea/ts/*` rules are imported from [eslint-plugin-typescript](https://www.npmjs.com/package/eslint-plugin-typescript).
124
+
- All `mysticatea/vue/*` rules are imported from [eslint-plugin-vue](https://www.npmjs.com/package/eslint-plugin-vue).
125
+
- The `mysticatea/prettier` rule is imported from [eslint-plugin-prettier](https://www.npmjs.com/package/eslint-plugin-prettier).
41
126
42
-
```json
43
-
{
44
-
"plugins": [
45
-
"mysticatea"
46
-
],
47
-
"rules": {
48
-
"mysticatea/arrow-parens": "error",
49
-
"mysticatea/block-scoped-var": "error",
50
-
"mysticatea/no-instanceof-array": "error",
51
-
"mysticatea/no-instanceof-wrapper": "error",
52
-
"mysticatea/no-literal-call": "error",
53
-
"mysticatea/no-this-in-static": "error",
54
-
"mysticatea/no-use-ignored-vars": "error",
55
-
"mysticatea/no-useless-rest-spread": "error",
56
-
"mysticatea/prefer-for-of": "error",
57
-
"arrow-parens": "off",
58
-
"block-scoped-var": "off",
59
-
"no-redeclare": "off"
60
-
}
61
-
}
62
-
```
127
+
> **Q:** Why don't you use those plugins directly?<br>
128
+
> **A:** The combination with shareable configs and plugins has some problems because shareable configs were not designed to be used with plugins. @nzakas illustrated a way to use plugins as shareable configs together with other plugins in the discussion [eslint/eslint#3458](https://github.com/eslint/eslint/issues/3458#issuecomment-257161846). This is the way.
129
+
130
+
## 🚥 Semantic Versioning Policy
63
131
64
-
## :anchor: Semantic Versioning Policy
65
-
66
-
`eslint-plugin-mysticatea` follows [semantic versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).
67
-
68
-
- Patch release (intended to not break your lint build)
69
-
- A bug fix in a rule that results in `eslint-plugin-mysticatea` reporting fewer errors.
70
-
- Improvements to documentation.
71
-
- Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
72
-
- Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
73
-
- Minor release (might break your lint build)
74
-
- A bug fix in a rule that results in `eslint-plugin-mysticatea` reporting more errors.
75
-
- A new rule is created.
76
-
- A new option to an existing rule is created.
77
-
- An existing rule is deprecated.
78
-
- Major release (likely to break your lint build)
79
-
- A support for old Node version is dropped.
80
-
- A support for old ESLint version is dropped.
81
-
- An existing rule is removed.
82
-
- An existing option of a rule is removed.
83
-
- An existing config is updated.
84
-
85
-
## :newspaper: Changelog
132
+
This plugin follows [semantic versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).
0 commit comments