Skip to content

Commit edde79c

Browse files
committed
build: improve config
1 parent b4481f4 commit edde79c

11 files changed

+74
-76
lines changed

Diff for: .browserslistrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
defaults
2+
not ie <= 8

Diff for: .eslintignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.local*
2+
.husky
3+
coverage
4+
dist
5+
docs
6+
node_modules

Diff for: .eslintrc

-31
This file was deleted.

Diff for: .eslintrc.js

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
root: true,
3+
extends: 'airbnb-base',
4+
env: {
5+
browser: true,
6+
},
7+
rules: {
8+
'import/no-extraneous-dependencies': 'off',
9+
'no-param-reassign': 'off',
10+
'no-restricted-properties': 'off',
11+
'valid-jsdoc': ['error', {
12+
requireReturn: false,
13+
}],
14+
},
15+
overrides: [
16+
{
17+
files: 'test/**/*.spec.js',
18+
env: {
19+
mocha: true,
20+
},
21+
globals: {
22+
Cropper: true,
23+
expect: true,
24+
},
25+
rules: {
26+
'no-new': 'off',
27+
'no-unused-expressions': 'off',
28+
},
29+
},
30+
],
31+
};

Diff for: .gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
*.local
1+
*.local*
2+
*.log
23
*.map
4+
.DS_Store
35
coverage
46
node_modules

Diff for: .stylelintignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.local*
2+
.husky
3+
coverage
4+
dist
5+
node_modules

Diff for: .stylelintrc

-16
This file was deleted.

Diff for: commitlint.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
extends: [
3+
'@commitlint/config-conventional',
4+
],
5+
};

Diff for: lint-staged.config.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
'*.js': 'eslint --fix',
3+
'*.{css,scss,html}': 'stylelint --fix',
4+
};

Diff for: package.json

+3-28
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
"compress:js": "uglifyjs dist/cropper.js -o dist/cropper.min.js -c -m --comments /^!/",
2323
"copy": "cpy dist/cropper.css docs/css",
2424
"lint": "npm run lint:js && npm run lint:css",
25-
"lint:css": "stylelint {src,docs,examples}/**/*.{css,scss,html} --fix",
26-
"lint:js": "eslint src test *.js --fix",
25+
"lint:css": "stylelint **/*.{css,scss,html} --fix",
26+
"lint:js": "eslint . --fix",
27+
"prepare": "husky install",
2728
"release": "npm run clean && npm run lint && npm run build && npm run compress && npm run copy && npm test",
2829
"start": "npm-run-all --parallel watch:*",
2930
"test": "karma start",
@@ -102,31 +103,5 @@
102103
"stylelint-config-standard-scss": "^3.0.0",
103104
"stylelint-order": "^5.0.0",
104105
"uglify-js": "^3.14.5"
105-
},
106-
"browserslist": [
107-
"last 2 versions",
108-
"> 1%",
109-
"not ie <= 8"
110-
],
111-
"commitlint": {
112-
"extends": [
113-
"@commitlint/config-conventional"
114-
]
115-
},
116-
"husky": {
117-
"hooks": {
118-
"pre-commit": "lint-staged",
119-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
120-
}
121-
},
122-
"lint-staged": {
123-
"{src,test}/**/*.js|*.conf*.js": [
124-
"eslint --fix",
125-
"git add"
126-
],
127-
"{src,docs}/**/*.{css,scss,html}": [
128-
"stylelint --fix",
129-
"git add"
130-
]
131106
}
132107
}

Diff for: stylelint.config.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
extends: 'stylelint-config-recommended-scss',
3+
plugins: [
4+
'stylelint-order',
5+
],
6+
rules: {
7+
'order/properties-alphabetical-order': true,
8+
},
9+
overrides: [
10+
{
11+
files: ['**/*.html'],
12+
customSyntax: 'postcss-html',
13+
},
14+
],
15+
};

0 commit comments

Comments
 (0)