Skip to content

Commit

Permalink
style: add eslint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Jan 14, 2020
1 parent d28bbe0 commit addc5bc
Show file tree
Hide file tree
Showing 54 changed files with 1,123 additions and 361 deletions.
21 changes: 21 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
parser: 'vue-eslint-parser',
env: {
'jest/globals': true,
commonjs: true,
es6: true,
node: true
},
extends: ['vuetify'],
plugins: ['jest'],
parserOptions: {
ecmaVersion: 2018,
parser: 'babel-eslint',
sourceType: 'module',
},
rules: {
'template-curly-spacing' : 'off',
'vue/require-default-prop': 'off',
indent : "off",
}
}
3 changes: 3 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = api => {
return {}
}
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
],
"private": true,
"scripts": {
"lint": "lerna run lint -- --fix",
"release": "lerna publish from-git"
},
"husky": {
Expand All @@ -12,11 +13,22 @@
}
},
"devDependencies": {
"babel-eslint": "^10.0.3",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.0",
"eslint-config-vuetify": "^0.4.1",
"eslint-plugin-import": "^2.20.0",
"eslint-plugin-jest": "^23.6.0",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^6.1.2",
"husky": "^3.1.0",
"lerna": "^3.19.0",
"lerna-changelog": "^0.8.3",
"semver": "^6.3.0",
"vue": "^2.6.4",
"vue-eslint-parser": "^7.0.0",
"vue-template-compiler": "^2.5.0",
"vuetify": "^2.1.13",
"webpack": "^4.0.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-plugin-utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function injectGoogleFontLink (api, font) {
const url = font.map(str => {
const {
family = str,
weights = '100,300,400,500,700,900'
weights = '100,300,400,500,700,900',
} = str.split(':')

return `${family}:${weights}`
Expand All @@ -38,7 +38,7 @@ function injectGoogleFontLink (api, font) {
function injectSassVariables (
api,
file,
modules = ['vue-modules', 'vue', 'normal-modules', 'normal']
modules = ['vue-modules', 'vue', 'normal-modules', 'normal'],
) {
api.chainWebpack(config => {
modules.forEach(match => {
Expand Down Expand Up @@ -192,5 +192,5 @@ module.exports = {
updateFile,
updateVuetifyObject,
VuetifyPresetGenerator,
VuetifyPresetService
VuetifyPresetService,
}
22 changes: 11 additions & 11 deletions packages/vue-cli-plugin-vuetify-essentials/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@ module.exports = api => {
api.extendPackage({
devDependencies: {
'@mdi/js': '*',
'axios': '*',
axios: '*',
'eslint-config-vuetify': '*',
'vue-analytics': '*',
'vue-meta': '*',
'vuex-pathify': '*',
'vuex-router-sync': '*',
'webfontloader': '*',
"lodash": "*",
webfontloader: '*',
lodash: '*',
},
eslintConfig: {
env: { jest: true },
extends: 'vuetify'
extends: 'vuetify',
},
jest: {
setupFiles: [
'<rootDir>/tests/index.js'
]
}
'<rootDir>/tests/index.js',
],
},
})

api.injectImports(api.entryFile, `import './plugins'`)
api.injectImports(api.entryFile, 'import \'./plugins\'')

api.onCreateComplete(() => {
const packagePath = api.resolve('package.json')
const package = require(packagePath)
const projectPackage = require(packagePath)

package.scripts.deploy = 'yarn build && now'
projectPackage.scripts.deploy = 'yarn build && now'

fs.writeFileSync(packagePath, JSON.stringify(package, null, 2))
fs.writeFileSync(packagePath, JSON.stringify(projectPackage, null, 2))

try {
fs.unlinkSync(api.resolve('src/views/About.vue'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { shallow, createLocalVue } from '@vue/test-utils'
const localVue = createLocalVue()

describe('AppBar', () => {
function mountFunction(options = {}) {
function mountFunction (options = {}) {
return shallow(AppBar, {
localVue,
...options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { shallow, createLocalVue } from '@vue/test-utils'
const localVue = createLocalVue()

describe('Drawer', () => {
function mountFunction(options = {}) {
function mountFunction (options = {}) {
return shallow(Drawer, {
localVue,
...options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { shallow, createLocalVue } from '@vue/test-utils'
const localVue = createLocalVue()

describe('View', () => {
function mountFunction(options = {}) {
function mountFunction (options = {}) {
return shallow(View, {
localVue,
...options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { shallow, createLocalVue } from '@vue/test-utils'
const localVue = createLocalVue()

describe('AppBar', () => {
function mountFunction(options = {}) {
function mountFunction (options = {}) {
return shallow(AppBar, {
localVue,
...options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { shallow, createLocalVue } from '@vue/test-utils'
const localVue = createLocalVue()

describe('Drawer', () => {
function mountFunction(options = {}) {
function mountFunction (options = {}) {
return shallow(Drawer, {
localVue,
...options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { shallow, createLocalVue } from '@vue/test-utils'
const localVue = createLocalVue()

describe('Footer', () => {
function mountFunction(options = {}) {
function mountFunction (options = {}) {
return shallow(Footer, {
localVue,
...options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { shallow, createLocalVue } from '@vue/test-utils'
const localVue = createLocalVue()

describe('View', () => {
function mountFunction(options = {}) {
function mountFunction (options = {}) {
return shallow(View, {
localVue,
...options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default new Vuetify({
mdiMenu,
mdiMonitorCellphone,
mdiMonitorDashboard,
mdiVuetify
mdiVuetify,
},
},
theme: {
Expand Down
4 changes: 2 additions & 2 deletions packages/vue-cli-plugin-vuetify-essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.8.3",
"main": "index.js",
"license": "MIT",
"devDependencies": {
"@release-it/conventional-changelog": "^1.1.0"
"scripts": {
"lint": "eslint --ext .js,.vue ."
}
}
4 changes: 3 additions & 1 deletion packages/vue-cli-plugin-vuetify-preset-basil/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"url": "git+https://github.com/vuetifyjs/vue-cli-plugin-vuetify.git",
"directory": "packages/vue-cli-plugin-vuetify-preset-basil"
},
"scripts": {},
"scripts": {
"lint": "eslint --ext .js,.vue ."
},
"bugs": {
"url": "https://github.com/vuetifyjs/vue-cli-plugin-vuetify/issues"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/vue-cli-plugin-vuetify-preset-crane/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"url": "git+https://github.com/vuetifyjs/vue-cli-plugin-vuetify.git",
"directory": "packages/vue-cli-plugin-vuetify-preset-crane"
},
"scripts": {},
"scripts": {
"lint": "eslint --ext .js,.vue ."
},
"bugs": {
"url": "https://github.com/vuetifyjs/vue-cli-plugin-vuetify/issues"
},
Expand Down
8 changes: 4 additions & 4 deletions packages/vue-cli-plugin-vuetify-preset-crane/preset/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ const preset = {
light: {
primary: '#356859',
secondary: '#FD5523',
accent: '#B9E4C9'
}
}
}
accent: '#B9E4C9',
},
},
},
}

module.exports = { preset }
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = api => {
VuetifyPresetGenerator(api, 'fortnightly', () => {
injectGoogleFontLink(api, [
'Libre+Franklin:300,400,500,700',
'Merriweather:400,400i,500,700,700i,900,900i'
'Merriweather:400,400i,500,700,700i,900,900i',
])
})
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"type": "git",
"url": "git+https://github.com/vuetifyjs/vue-cli-plugin-vuetify.git"
},
"scripts": {},
"scripts": {
"lint": "eslint --ext .js,.vue ."
},
"bugs": {
"url": "https://github.com/vuetifyjs/vue-cli-plugin-vuetify/issues"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const preset = {
light: {
primary: '#6B38FB',
secondary: '#6B38FB',
}
}
}
},
},
},
}

module.exports = { preset }
4 changes: 3 additions & 1 deletion packages/vue-cli-plugin-vuetify-preset-owl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"type": "git",
"url": "git+https://github.com/vuetifyjs/vue-cli-plugin-vuetify.git"
},
"scripts": {},
"scripts": {
"lint": "eslint --ext .js,.vue ."
},
"bugs": {
"url": "https://github.com/vuetifyjs/vue-cli-plugin-vuetify/issues"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/vue-cli-plugin-vuetify-preset-rally/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"type": "git",
"url": "git+https://github.com/vuetifyjs/vue-cli-plugin-vuetify.git"
},
"scripts": {},
"scripts": {
"lint": "eslint --ext .js,.vue ."
},
"bugs": {
"url": "https://github.com/vuetifyjs/vue-cli-plugin-vuetify/issues"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/vue-cli-plugin-vuetify-preset-reply/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"type": "git",
"url": "git+https://github.com/vuetifyjs/vue-cli-plugin-vuetify.git"
},
"scripts": {},
"scripts": {
"lint": "eslint --ext .js,.vue ."
},
"bugs": {
"url": "https://github.com/vuetifyjs/vue-cli-plugin-vuetify/issues"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/vue-cli-plugin-vuetify-preset-shrine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"type": "git",
"url": "git+https://github.com/vuetifyjs/vue-cli-plugin-vuetify.git"
},
"scripts": {},
"scripts": {
"lint": "eslint --ext .js,.vue ."
},
"bugs": {
"url": "https://github.com/vuetifyjs/vue-cli-plugin-vuetify/issues"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/vue-cli-plugin-vuetify-storybook/generator/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ module.exports = api => {
'@storybook/vue': '^5.2',
'babel-preset-vue': '^2.0.2',
'prism-react-renderer': '^0.1.7',
'prismjs': '^1.17.1',
prismjs: '^1.17.1',
'vue-storybook': '^1.1.0',
}
},
})

api.onCreateComplete(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ const withTemplate = makeDecorator({
const template = story.options &&
story.options.STORYBOOK_WRAPS &&
story.options.STORYBOOK_WRAPS.options &&
story.options.STORYBOOK_WRAPS.options.template || null
(story.options.STORYBOOK_WRAPS.options.template || null)

const channel = addons.getChannel()
channel.emit(EVENT_ID, { markup: beautify.html(template, { indent_size: 2 }) })

return story
}
},
})

export default withTemplate
Loading

0 comments on commit addc5bc

Please sign in to comment.