Skip to content

Commit 29e8dc6

Browse files
committed
Refactor code-style
1 parent 10be7d9 commit 29e8dc6

File tree

14 files changed

+191
-6869
lines changed

14 files changed

+191
-6869
lines changed

.babelrc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"presets": [
3-
["@babel/env"]
4-
]
2+
"presets": [["@babel/env"]]
53
}

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc.js

Lines changed: 0 additions & 23 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ yarn-error.log
44
.DS_Store
55
/dist
66
/coverage
7+
yarn.lock

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
coverage/
2+
dist/
3+
*.html
4+
*.md

package.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,33 @@
3737
"@babel/core": "^7.0.0",
3838
"@babel/preset-env": "^7.0.0",
3939
"@rollup/plugin-babel": "^5.0.0",
40-
"babel-eslint": "^10.0.0",
4140
"babel-jest": "^26.0.0",
42-
"eslint": "^7.0.0",
43-
"eslint-config-airbnb-base": "^14.0.0",
44-
"eslint-plugin-import": "^2.0.0",
4541
"glob": "^7.0.0",
4642
"jest-cli": "^26.0.0",
43+
"prettier": "^2.0.0",
4744
"remark-cli": "^9.0.0",
4845
"remark-preset-wooorm": "^8.0.0",
49-
"rollup": "^2.0.0"
46+
"rollup": "^2.0.0",
47+
"xo": "^0.39.0"
5048
},
5149
"scripts": {
5250
"build": "rollup -c",
53-
"format": "remark . -qfo && eslint . --fix",
51+
"format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
5452
"test:api": "jest",
5553
"test:dev": "jest --watchAll",
5654
"test": "yarn build && yarn format && yarn test:api"
5755
},
56+
"prettier": {
57+
"tabWidth": 2,
58+
"useTabs": false,
59+
"singleQuote": true,
60+
"bracketSpacing": false,
61+
"semi": false,
62+
"trailingComma": "none"
63+
},
64+
"xo": {
65+
"prettier": true
66+
},
5867
"jest": {
5968
"collectCoverage": true,
6069
"coveragePathIgnorePatterns": [

rollup.config.js

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
1-
import babel from '@rollup/plugin-babel';
2-
import pkg from './package.json';
1+
import babel from '@rollup/plugin-babel'
2+
import pkg from './package.json'
33

4-
export default {
4+
const config = {
55
input: 'src/index.js',
66
output: [
7-
{ file: pkg.main, format: 'cjs' },
8-
{ file: pkg.module, format: 'es' },
7+
{file: pkg.main, format: 'cjs'},
8+
{file: pkg.module, format: 'es'}
99
],
1010
plugins: [
1111
babel({
12-
presets: [
13-
['@babel/preset-env', { modules: false }],
14-
],
15-
babelrc: false,
16-
}),
12+
presets: [['@babel/preset-env', {modules: false}]],
13+
babelrc: false
14+
})
1715
],
18-
external: [
19-
'hastscript/html',
20-
'hastscript/svg',
21-
'web-namespaces',
22-
],
23-
};
16+
external: ['hastscript/html', 'hastscript/svg', 'web-namespaces']
17+
}
18+
19+
export default config

src/__fixtures__/doctype-nameless/index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
]
2828
}
2929
]
30-
}
30+
}

src/__fixtures__/doctype/index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@
2727
]
2828
}
2929
]
30-
}
30+
}

0 commit comments

Comments
 (0)