Skip to content
This repository was archived by the owner on Jun 10, 2023. It is now read-only.

Commit ea247ee

Browse files
committed
✅ Add lint
1 parent 74b4a0b commit ea247ee

File tree

5 files changed

+832
-33
lines changed

5 files changed

+832
-33
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/*.js

.eslintrc.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
root: true,
3+
parser: 'babel-eslint',
4+
parserOptions: {
5+
sourceType: 'module',
6+
},
7+
extends: 'vue',
8+
// add your custom rules here
9+
'rules': {
10+
// allow async-await
11+
'generator-star-spacing': 0,
12+
// allow debugger during development
13+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
14+
'comma-dangle': ['error', 'always-multiline'],
15+
},
16+
}

package.json

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,42 @@
11
{
22
"name": "vue-mdc",
3-
"version": "1.0.0",
4-
"main": "index.js",
3+
"version": "2.0.0-alpha.1",
4+
"main": "dist/vue-mdc.common.js",
5+
"browser": "dist/vue-mdc.js",
6+
"unpkg": "dist/vue-mdc.js",
7+
"style": "dist/vue-mdc.css",
58
"author": "Eduardo San Martin Morote <[email protected]>",
69
"license": "MIT",
10+
"files": [
11+
"dist",
12+
"src"
13+
],
714
"scripts": {
815
"dev": "webpack-dashboard -- webpack-dev-server --config build/webpack.config.dev.js --open",
16+
"test": "yon run lint && yon run test:unit",
917
"test:unit": "cross-env BABEL_ENV=test karma start test/karma.conf.js --single-run",
1018
"build:dll": "webpack --progress --config build/webpack.config.dll.js",
1119
"postinstall": "yon run build:dll",
20+
"lint": "eslint --ext js --ext jsx --ext vue src test/**/*.spec.js test/*.js build",
21+
"lint:fix": "yon run lint -- --fix",
22+
"lint:staged": "lint-staged",
1223
"build": "yon run build:common && yon run build:browser && yon run build:browser:min",
1324
"build:browser": "cross-env NODE_ENV=browser yon run build:browser:base",
1425
"build:browser:base": "webpack --config build/webpack.config.browser.js --progress --hide-modules",
1526
"build:browser:min": "cross-env NODE_ENV=production yon build:browser:base -- -p",
1627
"build:common": "cross-env NODE_ENV=common webpack --config build/webpack.config.common.js --progress --hide-modules"
1728
},
29+
"lint-staged": {
30+
"*.{vue,jsx,js}": [
31+
"eslint --fix",
32+
"git add"
33+
]
34+
},
35+
"pre-commit": "lint:staged",
1836
"devDependencies": {
1937
"add-asset-html-webpack-plugin": "^1.0.2",
2038
"babel-core": "^6.23.1",
39+
"babel-eslint": "^7.1.1",
2140
"babel-helper-vue-jsx-merge-props": "^2.0.2",
2241
"babel-loader": "^6.3.2",
2342
"babel-plugin-istanbul": "^4.0.0",
@@ -29,7 +48,11 @@
2948
"chai": "^3.5.0",
3049
"cross-env": "^3.1.4",
3150
"css-loader": "^0.26.1",
51+
"eslint": "^3.15.0",
52+
"eslint-config-vue": "^2.0.2",
53+
"eslint-plugin-vue": "^2.0.1",
3254
"extract-text-webpack-plugin": "beta",
55+
"function-bind": "^1.1.0",
3356
"html-webpack-plugin": "^2.28.0",
3457
"karma": "^1.4.1",
3558
"karma-coverage": "^1.1.1",
@@ -39,10 +62,12 @@
3962
"karma-sourcemap-loader": "^0.3.7",
4063
"karma-spec-reporter": "^0.0.26",
4164
"karma-webpack": "^2.0.2",
65+
"lint-staged": "^3.3.0",
4266
"material-components-web": "^0.4.0",
4367
"mocha": "^3.2.0",
4468
"mocha-css": "^1.0.1",
4569
"node-sass": "^4.5.0",
70+
"pre-commit": "^1.2.2",
4671
"sass-loader": "^6.0.1",
4772
"sinon": "^1.17.7",
4873
"sinon-chai": "^2.8.0",

test/.eslintrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"env": {
3+
"mocha": true
4+
},
5+
"globals": {
6+
"expect": true,
7+
"sinon": true
8+
}
9+
}

0 commit comments

Comments
 (0)