Skip to content

Commit 6293bce

Browse files
committed
Update linter rules
1 parent 5a57ac3 commit 6293bce

28 files changed

+437
-255
lines changed

.eslintrc

+12-25
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,26 @@
11
{
2-
"extends": ["@antfu/ts", "plugin:solid/typescript"],
2+
"extends": ["artisan", "plugin:solid/typescript"],
33
"plugins": ["solid"],
44
"rules": {
5-
"@typescript-eslint/brace-style": [2, "1tbs"],
6-
"@typescript-eslint/consistent-type-definitions": [0, {}],
7-
"@typescript-eslint/indent": [0, {}],
8-
"@typescript-eslint/member-delimiter-style": [
9-
2,
10-
{
11-
"multiline": {
12-
"delimiter": "comma"
13-
},
14-
"singleline": {
15-
"delimiter": "comma"
16-
}
17-
}
18-
],
19-
"@typescript-eslint/no-use-before-define": [0, {}],
20-
"antfu/if-newline": [0, {}],
21-
"curly": [0, {}],
22-
"indent": ["error", 2],
23-
"multiline-ternary": [0, {}],
24-
"solid/components-return-once": [0, {}]
5+
"solid/components-return-once": ["off", {}]
256
},
267
"overrides": [
278
{
28-
"files": "./.github/**/*",
9+
"files": ["./**/*.md/*.ts"],
10+
"rules": {
11+
"@typescript-eslint/no-unused-vars": ["off"]
12+
}
13+
},
14+
{
15+
"files": ["./src/index.tsx"],
2916
"rules": {
30-
"yml/no-empty-mapping-value": [0, {}]
17+
"eslint-comments/no-unlimited-disable": ["off", {}]
3118
}
3219
},
3320
{
34-
"files": "./src/index.tsx",
21+
"files": ["./types/**/*"],
3522
"rules": {
36-
"eslint-comments/no-unlimited-disable": [0, {}]
23+
"@typescript-eslint/no-namespace": ["off"]
3724
}
3825
}
3926
]

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -115,29 +115,23 @@ The `ink-mde/vue` subpath exports a Vue 3 component.
115115
#### Minimal setup
116116

117117
```vue
118-
<template>
119-
<InkMde v-model="markdown" />
120-
</template>
121-
122118
<script lang="ts" setup>
123119
import InkMde from 'ink-mde/vue'
124120
import { ref } from 'vue'
125121
126122
const markdown = ref('# Hello, World!')
127123
</script>
124+
125+
<template>
126+
<InkMde v-model="markdown" />
127+
</template>
128128
```
129129

130130
#### Custom Options
131131

132132
The Vue component forwards all options that `ink-mde` supports, and it uses a deep watcher to ensure your `options` are reactive.
133133

134134
```vue
135-
<template>
136-
<input v-model="options.interface.appearance" type="radio" value="dark"> dark
137-
<input v-model="options.interface.appearance" type="radio" value="light"> light
138-
<InkMde v-model="markdown" :options="options" />
139-
</template>
140-
141135
<script lang="ts" setup>
142136
import InkMde from 'ink-mde/vue'
143137
import { reactive, ref } from 'vue'
@@ -149,6 +143,12 @@ const options = reactive({
149143
},
150144
})
151145
</script>
146+
147+
<template>
148+
<input v-model="options.interface.appearance" type="radio" value="dark"> dark
149+
<input v-model="options.interface.appearance" type="radio" value="light"> light
150+
<InkMde v-model="markdown" :options="options" />
151+
</template>
152152
```
153153

154154
### Examples for `ink-mde/svelte`

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@
151151
"style-mod": "^4.1.0"
152152
},
153153
"devDependencies": {
154-
"@antfu/eslint-config-ts": "^0.43.1",
155154
"@rollup/plugin-alias": "^5.1.0",
156155
"@types/express": "^4.17.21",
157156
"@types/katex": "^0.16.7",
@@ -160,6 +159,7 @@
160159
"@vue/tsconfig": "^0.5.1",
161160
"embedme": "github:davidmyersdev/embedme#live-fork",
162161
"eslint": "^8.56.0",
162+
"eslint-config-artisan": "^0.3.0",
163163
"eslint-plugin-solid": "^0.13.1",
164164
"express": "^4.18.2",
165165
"jsdom": "^23.0.1",

plugins/katex/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language'
22
import { EditorView } from '@codemirror/view'
33
import { plugin, pluginTypes } from 'ink-mde'
4-
import { useModule } from '/src/modules'
54
import { buildBlockWidgetDecoration, buildLineDecoration, buildWidget, nodeDecorator } from '/lib/codemirror-kit'
5+
import { useModule } from '/src/modules'
66
import { grammar, mathInline, mathInlineMark, mathInlineMarkClose, mathInlineMarkOpen } from './grammar'
77

88
const render = (text: string, element: HTMLElement) => {

0 commit comments

Comments
 (0)