Skip to content

Commit

Permalink
Update ESLint config (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
gucong3000 committed Mar 23, 2018
1 parent 62f5ba0 commit 16df76f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 45 deletions.
54 changes: 13 additions & 41 deletions .eslintrc.json
@@ -1,6 +1,5 @@
{
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "script",
"impliedStrict": false
},
Expand All @@ -13,50 +12,39 @@
],
"root": true,
"rules": {
"arrow-spacing": [
"comma-dangle": [
"error",
{
"after": true,
"before": true
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}
],
"comma-dangle": [
"error",
"always-multiline"
],
"comma-spacing": [
"error",
{
"after": true,
"before": false
}
],
"eqeqeq": [
"error",
"smart"
],
"indent": [
"error",
"tab",
{
"SwitchCase": 1
}
],
"key-spacing": [
"error"
],
"keyword-spacing": [
"error"
],
"no-unused-expressions": [
"error"
],
"no-tabs": [
"off"
],
"no-var": [
"error"
],
"prefer-arrow-callback": [
"error"
],
"prefer-const": [
"error"
],
Expand All @@ -66,30 +54,14 @@
],
"semi": [
"error",
"always"
],
"space-before-blocks": [
"error"
],
"space-before-function-paren": [
"error"
],
"space-infix-ops": [
"error"
],
"spaced-comment": [
"error",
"always"
"always",
{
"omitLastInOneLineBlock": false
}
],
"strict": [
"error",
"safe"
],
"valid-jsdoc": [
"warn",
{
"requireReturn": false
}
]
},
"overrides": [
Expand Down
2 changes: 1 addition & 1 deletion lib/parser.js
Expand Up @@ -27,7 +27,7 @@ function parser (source, opts) {
const document = new Document();
const parseStyle = docFixer(source, opts);
let index = 0;
[].concat(styleJs, styleHtm, styleMd).filter(Boolean).sort(function (a, b) {
[].concat(styleJs, styleHtm, styleMd).filter(Boolean).sort((a, b) => {
return a.startIndex - b.startIndex;
}).forEach(style => {
const root = parseStyle(style);
Expand Down
6 changes: 3 additions & 3 deletions test/markdown.js
Expand Up @@ -32,7 +32,7 @@ describe("markdown tests", () => {
"And the end.",
].join("\n");

it("CSS", function () {
it("CSS", () => {
return postcss([
root => {
expect(root.nodes).to.have.lengthOf(4);
Expand Down Expand Up @@ -67,7 +67,7 @@ describe("markdown tests", () => {
});
});

it("without code blocks", function () {
it("without code blocks", () => {
return postcss([
root => {
expect(root.nodes).to.have.lengthOf(0);
Expand All @@ -80,7 +80,7 @@ describe("markdown tests", () => {
});
});

it("stylefmt", function () {
it("stylefmt", () => {
const source = [
"title: Something Special",
"```css",
Expand Down

0 comments on commit 16df76f

Please sign in to comment.