Skip to content

Commit 5d059f5

Browse files
committed
refactor: add eslint
1 parent 486d419 commit 5d059f5

Some content is hidden

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

52 files changed

+1851
-1270
lines changed

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
!.vuepress
2+
.cache
3+
.temp
4+
dist

.eslintrc.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es2021: true
5+
},
6+
extends: [
7+
'plugin:vue/vue3-essential',
8+
'standard'
9+
],
10+
parserOptions: {
11+
ecmaVersion: 'latest',
12+
sourceType: 'module'
13+
},
14+
plugins: [
15+
'vue'
16+
],
17+
rules: {
18+
}
19+
}

core/build/rollup.config.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import commonjs from '@rollup/plugin-commonjs'; // Convert CommonJS modules to ES6
2-
import vue from 'rollup-plugin-vue'; // Handle .vue SFC files
1+
import commonjs from '@rollup/plugin-commonjs' // Convert CommonJS modules to ES6
2+
import vue from 'rollup-plugin-vue' // Handle .vue SFC files
33
export default {
4-
input: 'src/index.js', // Path relative to package.json
5-
output: {
6-
name: 'core',
7-
exports: 'named',
8-
},
9-
plugins: [
10-
commonjs(),
11-
vue({
12-
css: true, // Dynamically inject css as a <style> tag
13-
compileTemplate: true, // Explicitly convert template to render function
14-
}),
15-
],
16-
};
4+
input: 'src/index.js', // Path relative to package.json
5+
output: {
6+
name: 'core',
7+
exports: 'named'
8+
},
9+
plugins: [
10+
commonjs(),
11+
vue({
12+
css: true, // Dynamically inject css as a <style> tag
13+
compileTemplate: true // Explicitly convert template to render function
14+
})
15+
]
16+
}

core/dev/example-usage.vue

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
</template>
2222

2323
<div>-</div>
24-
24+
2525
<div>error:{{error}}</div>
2626
<div>period:{{period.attrs.value}}</div>
2727
<div v-for="f in fields" :key="'div'+f.id">{{f.id}}: {{f.attrs.value}}, {{f.cron}}, {{f.selectedStr}}</div>
@@ -42,31 +42,31 @@ select[multiple] {
4242
import VueCronCore from '../src/core'
4343
4444
export default {
45-
components: {
46-
VueCronCore
47-
},
48-
props: {
45+
components: {
46+
VueCronCore
47+
},
48+
props: {
49+
50+
},
51+
data () {
52+
return {
53+
value: '* * * * *'
54+
}
55+
},
56+
57+
computed: {
58+
59+
},
4960
50-
},
51-
data(){
52-
return {
53-
value: '* * * * *'
54-
}
55-
},
61+
watch: {
5662
57-
computed: {
58-
59-
},
60-
61-
watch: {
62-
63-
},
63+
},
6464
65-
methods: {
66-
getSelected(select){
67-
let options = select && select.options;
68-
return Array.from(options).filter((opt) => opt.selected).map((opt) => opt.value)
69-
},
65+
methods: {
66+
getSelected (select) {
67+
const options = select && select.options
68+
return Array.from(options).filter((opt) => opt.selected).map((opt) => opt.value)
7069
}
70+
}
7171
}
72-
</script>
72+
</script>

core/dev/serve.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { createApp } from 'vue';
2-
import example from './example-usage.vue';
1+
import { createApp } from 'vue'
2+
import example from './example-usage.vue'
33

44
const app = createApp(example)
5-
app.mount('#app');
5+
app.mount('#app')

core/jest.config.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@
55

66
module.exports = {
77

8-
coverageProvider: "v8",
8+
coverageProvider: 'v8',
99

10-
11-
"moduleFileExtensions": [
12-
"js",
13-
"ts",
14-
"json",
10+
moduleFileExtensions: [
11+
'js',
12+
'ts',
13+
'json',
1514
// tell Jest to handle `*.vue` files
16-
"vue"
15+
'vue'
1716
],
18-
"transform": {
17+
transform: {
1918
'^.+\\.vue$': 'vue-jest',
2019
'^.+\\.(js|jsx)?$': 'babel-jest'
2120
},
2221
moduleNameMapper: {
2322
'^@/(.*)$': '<rootDir>/src/$1'
24-
},
25-
//transformIgnorePatterns: ['<rootDir>/node_modules/']
26-
};
23+
}
24+
// transformIgnorePatterns: ['<rootDir>/node_modules/']
25+
}

0 commit comments

Comments
 (0)