Skip to content

Commit 05b712a

Browse files
authored
Update linter (#54)
1 parent 82616d6 commit 05b712a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+653
-462
lines changed

.eslintrc.js

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,28 @@ module.exports = {
99
},
1010
plugins: ["internal-rules"],
1111
extends: [
12-
"plugin:@mysticatea/es2015",
13-
"plugin:@mysticatea/+node",
14-
"plugin:@mysticatea/+eslint-plugin",
12+
"plugin:@ota-meshi/recommended",
13+
"plugin:@ota-meshi/+node",
14+
"plugin:@ota-meshi/+typescript",
15+
"plugin:@ota-meshi/+eslint-plugin",
16+
"plugin:@ota-meshi/+prettier",
17+
"plugin:@ota-meshi/+json",
1518
],
1619
rules: {
1720
"require-jsdoc": "error",
1821
"no-warning-comments": "warn",
1922
"no-lonely-if": "off",
20-
"@mysticatea/ts/ban-ts-ignore": "off",
23+
"@typescript-eslint/ban-ts-ignore": "off",
24+
"eslint-comments/no-unused-disable": "error",
25+
"@typescript-eslint/no-non-null-assertion": "off",
2126
},
2227
overrides: [
2328
{
2429
files: ["*.ts"],
30+
parser: "@typescript-eslint/parser",
2531
rules: {
26-
"@mysticatea/ts/no-require-imports": "off",
27-
"@mysticatea/ts/no-var-requires": "off",
32+
"@typescript-eslint/no-require-imports": "off",
33+
"@typescript-eslint/no-var-requires": "off",
2834
"no-implicit-globals": "off",
2935
},
3036
parserOptions: {
@@ -35,7 +41,7 @@ module.exports = {
3541
{
3642
files: ["lib/rules/**"],
3743
rules: {
38-
"@mysticatea/eslint-plugin/report-message-format": [
44+
"eslint-plugin/report-message-format": [
3945
"error",
4046
"[^a-z].*\\.$",
4147
],
@@ -46,7 +52,35 @@ module.exports = {
4652
"https://future-architect.github.io/eslint-plugin-vue-scoped-css/rules/{{name}}.html",
4753
},
4854
],
49-
"@mysticatea/eslint-plugin/require-meta-docs-url": "off",
55+
"eslint-plugin/require-meta-docs-url": "off",
56+
57+
"@typescript-eslint/naming-convention": [
58+
"error",
59+
{
60+
selector: "default",
61+
format: ["camelCase"],
62+
leadingUnderscore: "allow",
63+
trailingUnderscore: "allow",
64+
},
65+
{
66+
selector: "variable",
67+
format: ["camelCase", "UPPER_CASE"],
68+
leadingUnderscore: "allow",
69+
trailingUnderscore: "allow",
70+
},
71+
{
72+
selector: "typeLike",
73+
format: ["PascalCase"],
74+
},
75+
{
76+
selector: "property",
77+
format: null,
78+
},
79+
{
80+
selector: "method",
81+
format: null,
82+
},
83+
],
5084
},
5185
},
5286
{
@@ -78,19 +112,15 @@ module.exports = {
78112
ecmaVersion: 2019,
79113
parser: "babel-eslint",
80114
},
115+
extends: ["plugin:@ota-meshi/+vue2", "plugin:@ota-meshi/+prettier"],
81116
globals: {
82117
window: true,
83118
},
84119
rules: {
85120
"require-jsdoc": "off",
86-
"@mysticatea/vue/html-closing-bracket-newline": "off",
87-
"@mysticatea/vue/max-attributes-per-line": "off",
88-
"@mysticatea/vue/comma-dangle": "off",
89-
"@mysticatea/vue/html-indent": "off",
90-
"@mysticatea/vue/html-self-closing": "off",
91-
"@mysticatea/node/no-unsupported-features/es-syntax": "off",
92-
"@mysticatea/node/no-missing-import": "off",
93-
"@mysticatea/node/no-missing-require": "off",
121+
"node/no-unsupported-features/es-syntax": "off",
122+
"node/no-missing-import": "off",
123+
"node/no-missing-require": "off",
94124
},
95125
},
96126
],

docs/.vuepress/categories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const categoryRules = categoryIds
4343
for (const categoryId of Object.keys(categoryRules)) {
4444
if (categoryId !== "uncategorized" && !categoryTitles[categoryId]) {
4545
throw new Error(
46-
`Category "${categoryId}" does not have a title defined.`
46+
`Category "${categoryId}" does not have a title defined.`,
4747
)
4848
}
4949
}
@@ -52,7 +52,7 @@ module.exports = categoryIds.map((categoryId) => ({
5252
categoryId,
5353
title: categoryTitles[categoryId],
5454
rules: (categoryRules[categoryId] || []).filter(
55-
(rule) => !rule.meta.deprecated
55+
(rule) => !rule.meta.deprecated,
5656
),
5757
}))
5858
// .filter(category => category.rules.length >= 1)

docs/.vuepress/components/components/EslintPluginEditor.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default {
124124
125125
linter.defineParser(
126126
"vue-eslint-parser",
127-
require("vue-eslint-parser")
127+
require("vue-eslint-parser"),
128128
)
129129
130130
const vm = this
@@ -151,25 +151,25 @@ export default {
151151
monaco.languages.typescript.typescriptDefaults.setDiagnosticsOptions(
152152
{
153153
validate: false,
154-
}
154+
},
155155
)
156156
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions(
157157
{
158158
validate: false,
159-
}
159+
},
160160
)
161161
})
162162
editor.$watch("codeEditor", () => {
163163
if (editor.codeEditor) {
164164
editor.codeEditor.onDidChangeModelDecorations(() =>
165-
this.onDidChangeModelDecorations(editor.codeEditor)
165+
this.onDidChangeModelDecorations(editor.codeEditor),
166166
)
167167
}
168168
})
169169
editor.$watch("fixedCodeEditor", () => {
170170
if (editor.fixedCodeEditor) {
171171
editor.fixedCodeEditor.onDidChangeModelDecorations(() =>
172-
this.onDidChangeModelDecorations(editor.fixedCodeEditor)
172+
this.onDidChangeModelDecorations(editor.fixedCodeEditor),
173173
)
174174
}
175175
})

docs/.vuepress/components/components/RulesSettings.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212
<input
1313
:checked="
1414
category.rules.every((rule) =>
15-
isErrorState(rule.ruleId)
15+
isErrorState(rule.ruleId),
1616
)
1717
"
1818
type="checkbox"
1919
:indeterminate.prop="
2020
!category.rules.every((rule) =>
21-
isErrorState(rule.ruleId)
21+
isErrorState(rule.ruleId),
2222
) &&
2323
!category.rules.every(
24-
(rule) => !isErrorState(rule.ruleId)
24+
(rule) => !isErrorState(rule.ruleId),
2525
)
2626
"
2727
@input="onAllClick(category, $event)"
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
module.exports = {
2-
rules: {
3-
"@mysticatea/prettier": "off"
4-
}
5-
}
2+
rules: {
3+
"prettier/prettier": "off",
4+
"vue/component-tags-order": "off",
5+
"vue-scoped-css/no-unused-selector": "off"
6+
},
7+
}

docs/.vuepress/components/demo/demo-code.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
<div class="vue-input" :class="classes">
33
<div class="vue-input__input-wrapper">
44
<label> {{ label }} </label>
5-
<input class="vue-input__input" value="value" @input="$emit('input', $event.target.value)">
5+
<input
6+
class="vue-input__input"
7+
value="value"
8+
@input="$emit('input', $event.target.value)"
9+
/>
610
</div>
711
<div>
812
<slot name="trailing"></slot>
@@ -20,7 +24,8 @@
2024
.vue-input__input,
2125
.vue-input > .vue-input__input-wrapper > .vue-input__input,
2226
.vue-input >>> .child-classes,
23-
.vue-input--disabled { }
27+
.vue-input--disabled {
28+
}
2429
</style>
2530

2631
<script>

docs/.vuepress/components/demo/stylelint.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module.exports = {
55
indentation: null,
66
"selector-max-empty-lines": null,
77
"selector-type-no-unknown": null,
8-
"block-no-empty": null
8+
"block-no-empty": null,
99
},
1010
}
11-

docs/.vuepress/components/eslint-code-block.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default {
5050
return nodes
5151
.map(
5252
(node) =>
53-
node.text || this.computeCodeFromSlot(node.children)
53+
node.text || this.computeCodeFromSlot(node.children),
5454
)
5555
.join("")
5656
},

docs/.vuepress/components/rules/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ for (const k of Object.keys(coreRules)) {
9191
}
9292

9393
allRules.sort((a, b) =>
94-
a.ruleId > b.ruleId ? 1 : a.ruleId < b.ruleId ? -1 : 0
94+
a.ruleId > b.ruleId ? 1 : a.ruleId < b.ruleId ? -1 : 0,
9595
)
9696

9797
export const categories = []
@@ -120,7 +120,7 @@ categories.sort((a, b) =>
120120
? 1
121121
: a.title < b.title
122122
? -1
123-
: 0
123+
: 0,
124124
)
125125

126126
export const DEFAULT_RULES_CONFIG = allRules.reduce((c, r) => {

docs/.vuepress/components/state/deserialize.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export function deserializeState(serializedString) {
3636
}
3737
}
3838
} catch (error) {
39+
// eslint-disable-next-line no-console -- demo
3940
console.error(error)
4041
}
4142

0 commit comments

Comments
 (0)