Skip to content

Commit eacb0da

Browse files
committed
style: add prettier \o/
1 parent 0f713cc commit eacb0da

4 files changed

Lines changed: 50 additions & 18 deletions

File tree

.eslintrc.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
module.exports = {
2-
extends: 'semistandard',
2+
extends: ['semistandard', 'prettier'],
3+
34
env: {
45
node: true,
56
browser: true,
6-
mocha: true
7+
mocha: true,
78
},
89

910
parserOptions: {
1011
parser: '@babel/eslint-parser',
1112
ecmaVersion: 2021,
1213
ecmaFeatures: {
1314
globalReturn: false,
14-
jsx: false
15+
jsx: false,
1516
},
16-
sourceType: 'module'
17+
sourceType: 'module',
1718
},
1819

19-
plugins: ['import', 'node', 'promise', 'standard']
20+
plugins: ['import', 'node', 'promise', 'standard'],
2021
};

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lib/
2+
node_modules/

package-lock.json

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@
22
"name": "@prepair/basic-loader",
33
"version": "1.2.1",
44
"description": "David Walsh's super simple loader for loading image, CSS, and JavaScript files.",
5-
"main": "lib/basic-loader.js",
6-
"scripts": {
7-
"lint": "eslint src",
8-
"test": "cross-env NODE_ENV=test mocha --exit 'src/**/*.spec.js'",
9-
"test:watch": "npm t -- --watch --reporter min",
10-
"build": "shx rm -rf lib && cross-env MODULES=cjs babel --ignore **/*.spec.js --out-dir lib src && cross-env MODULES=amd babel --out-file lib/basic-loader-amd.js src/basic-loader.js",
11-
"publish-test": "shx rm -rf docs && mkdir docs && shx cp -r e2e/* docs/ && shx mv docs/test.html docs/index.html && shx cp lib/basic-loader-amd.js docs/basic-loader-amd.js && shx sed -i s/..\\/lib/.\\//g docs/index.html",
12-
"release": "npm run build && git status --porcelain && git checkout master && git pull origin master && standard-version && git push --follow-tags origin master && npm publish --access=public",
13-
"prepare": "husky install"
14-
},
15-
"lint-staged": {
16-
"*.js": "eslint --cache --fix"
17-
},
185
"repository": {
196
"type": "git",
207
"url": "git+https://github.com/prepair/basic-loader.git"
@@ -29,6 +16,34 @@
2916
"url": "https://github.com/prepair/basic-loader/issues"
3017
},
3118
"homepage": "https://github.com/prepair/basic-loader#readme",
19+
"main": "lib/basic-loader.js",
20+
"scripts": {
21+
"lint": "eslint src",
22+
"test": "cross-env NODE_ENV=test mocha --exit 'src/**/*.spec.js'",
23+
"test:watch": "npm t -- --watch --reporter min",
24+
"build": "shx rm -rf lib && cross-env MODULES=cjs babel --ignore **/*.spec.js --out-dir lib src && cross-env MODULES=amd babel --out-file lib/basic-loader-amd.js src/basic-loader.js",
25+
"publish-test": "shx rm -rf docs && mkdir docs && shx cp -r e2e/* docs/ && shx mv docs/test.html docs/index.html && shx cp lib/basic-loader-amd.js docs/basic-loader-amd.js && shx sed -i s/..\\/lib/.\\//g docs/index.html",
26+
"release": "npm run build && git status --porcelain && git checkout master && git pull origin master && standard-version && git push --follow-tags origin master && npm publish --access=public",
27+
"prepare": "husky install"
28+
},
29+
"prettier": {
30+
"printWidth": 120,
31+
"tabWidth": 2,
32+
"useTabs": false,
33+
"semi": true,
34+
"singleQuote": true,
35+
"quoteProps": "as-needed",
36+
"trailingComma": "es5",
37+
"bracketSpacing": true,
38+
"arrowParens": "always",
39+
"endOfLine": "lf"
40+
},
41+
"lint-staged": {
42+
"*.js": [
43+
"eslint --cache --fix",
44+
"prettier --write --ignore-unknown"
45+
]
46+
},
3247
"devDependencies": {
3348
"@babel/cli": "^7.14.3",
3449
"@babel/core": "^7.14.3",
@@ -37,6 +52,7 @@
3752
"chai": "^4.3.4",
3853
"cross-env": "^7.0.3",
3954
"eslint": "^7.27.0",
55+
"eslint-config-prettier": "^8.3.0",
4056
"eslint-config-semistandard": "^15.0.1",
4157
"eslint-config-standard": "^16.0.3",
4258
"eslint-plugin-import": "^2.23.3",
@@ -46,6 +62,7 @@
4662
"husky": "^6.0.0",
4763
"lint-staged": "^11.0.0",
4864
"mocha": "^8.4.0",
65+
"prettier": "^2.3.0",
4966
"shx": "^0.3.3",
5067
"sinon": "^11.1.1",
5168
"sinon-chai": "^3.7.0",

0 commit comments

Comments
 (0)