Skip to content

Commit

Permalink
chore(deps): update dependency eslint-plugin-prettier to v5 (#72)
Browse files Browse the repository at this point in the history
* chore(deps): update dependency eslint-plugin-prettier to v5

* Update package.json

* format

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Yosuke Ota <[email protected]>
  • Loading branch information
renovate[bot] and ota-meshi authored Jan 14, 2025
1 parent 55fd3c7 commit 65ef1b6
Show file tree
Hide file tree
Showing 13 changed files with 68 additions and 37 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 👔 Format

on:
workflow_dispatch: null

jobs:
format:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
- name: Install deps
run: npm install -f
- name: Format
run: npm run eslint-fix
- name: Commit
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
if [ -z "$(git status --porcelain)" ]; then
echo "no formatting changed"
exit 0
fi
git commit -m "chore: format"
git push
echo "pushed formatting changes https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"
2 changes: 1 addition & 1 deletion lib/markdown/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Document extends PostCssDocument {
return super.toString(
stringifier || {
stringify: require("../stringify"),
}
},
);
}

Expand Down
8 changes: 4 additions & 4 deletions lib/markdown/extract-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ function extractStyles(source, opts) {
lang: lang.toLowerCase(),
blockInfo,
},
parent
parent,
);
}

function processHtml(nodes, parent) {
if (
nodes.every(
(node) => node.type === "text" || isHtmlComment(node.value || "")
(node) => node.type === "text" || isHtmlComment(node.value || ""),
)
) {
// all comment
Expand All @@ -77,11 +77,11 @@ function extractStyles(source, opts) {
isMarkdown: false,
content: source.slice(
startIndex,
nodes[nodes.length - 1].position.end.offset
nodes[nodes.length - 1].position.end.offset,
),
lang: "html",
},
parent
parent,
);
}

Expand Down
10 changes: 5 additions & 5 deletions lib/markdown/parse-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class LocalFixer {
this.fixLocation(error.input);
error.message = error.message.replace(
/:\d+:\d+:/,
`:${error.line}:${error.column}:`
`:${error.line}:${error.column}:`,
);
}
return error;
Expand All @@ -110,8 +110,8 @@ class LocalFixer {
document: this.source,
map: false,
},
style.opts
)
style.opts,
),
);
} catch (error) {
this.error(error);
Expand Down Expand Up @@ -140,7 +140,7 @@ class LocalFixer {

getRootEndOffset(root) {
const loc = new Locations(root.source.input.css).getLocFromOffset(
root.source.input.css.length
root.source.input.css.length,
);
if (loc.line === 1) {
loc.column += root.source.start.column - 1;
Expand Down Expand Up @@ -182,7 +182,7 @@ function parseStyles(source, opts, styles) {
}
root.raws.codeBefore = source.slice(
index,
getOffsetFromLoc(root.source.start)
getOffsetFromLoc(root.source.start),
);

// Note: Stylelint is still using this property.
Expand Down
2 changes: 1 addition & 1 deletion lib/stringify.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function stringify(node, builder) {
customAppender.appendCodeAfter(
root.raws.codeAfter || "",
root,
"codeAfter"
"codeAfter",
);
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion lib/syntax/build-syntax-resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = function buildSyntaxResolver(config) {
}
if (definedLangs.has(lang)) {
throw new Error(
`Cannot resolve module "${syntax}". It's likely that the module isn't installed correctly. Try reinstalling by running the \`npm install ${syntax}@latest --save-dev\``
`Cannot resolve module "${syntax}". It's likely that the module isn't installed correctly. Try reinstalling by running the \`npm install ${syntax}@latest --save-dev\``,
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"eslint-plugin-jsonc": "^2.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-node-dependencies": "^0.12.0",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-regexp": "^1.4.1",
"eslint-plugin-yml": "^1.0.0",
"mocha": "^10.0.0",
Expand All @@ -82,7 +82,7 @@
"postcss-less": "^6.0.0",
"postcss-scss": "^4.0.0",
"postcss-styl": "^0.12.0",
"prettier": "^2.4.1",
"prettier": "^3.0.0",
"stylelint": "^14.4.0",
"stylelint-config-standard": "^29.0.0",
"sugarss": "^4.0.0"
Expand Down
26 changes: 13 additions & 13 deletions test/document-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe("api tests", () => {
"}",
"b {}",
"```",
].join("\n")
].join("\n"),
);
});
});
Expand Down Expand Up @@ -73,7 +73,7 @@ describe("api tests", () => {
"\tdisplay: flex;",
"}",
"```",
].join("\n")
].join("\n"),
);
});
});
Expand All @@ -87,7 +87,7 @@ describe("api tests", () => {
root.last,
postcss.rule({
selector: "b",
})
}),
);
},
};
Expand Down Expand Up @@ -127,7 +127,7 @@ describe("api tests", () => {
"\tdisplay: flex;",
"}",
"```",
].join("\n")
].join("\n"),
);
});
});
Expand All @@ -141,7 +141,7 @@ describe("api tests", () => {
root.first,
postcss.rule({
selector: "b",
})
}),
);
},
};
Expand Down Expand Up @@ -180,7 +180,7 @@ describe("api tests", () => {
"\tdisplay: flex;",
"}b {}",
"```",
].join("\n")
].join("\n"),
);
});
});
Expand Down Expand Up @@ -219,7 +219,7 @@ describe("api tests", () => {
"\tdisplay: flex;",
"}",
"```",
].join("\n")
].join("\n"),
);
});
});
Expand Down Expand Up @@ -260,7 +260,7 @@ describe("api tests", () => {
"\tdisplay: flex;",
"}b {}",
"```",
].join("\n")
].join("\n"),
);
});
});
Expand Down Expand Up @@ -298,7 +298,7 @@ describe("api tests", () => {
"b {}",
"",
"```",
].join("\n")
].join("\n"),
);
});
});
Expand Down Expand Up @@ -332,7 +332,7 @@ describe("api tests", () => {
//
"<style>b {}</style>",
"<style>b {}</style>",
].join("\n")
].join("\n"),
);
});
});
Expand Down Expand Up @@ -366,7 +366,7 @@ describe("api tests", () => {
"```css",
"b {}",
"```",
].join("\n")
].join("\n"),
);
});
});
Expand Down Expand Up @@ -401,7 +401,7 @@ describe("api tests", () => {
"```css",
"b {}",
"```",
].join("\n")
].join("\n"),
);
});
});
Expand Down Expand Up @@ -435,7 +435,7 @@ describe("api tests", () => {
"> ```css",
"> b {}",
"> ```",
].join("\n")
].join("\n"),
);
});
});
Expand Down
6 changes: 3 additions & 3 deletions test/error.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe("error tests", () => {
expect(() =>
parser.parse(md, {
from: "markdown.md",
})
}),
).to.throw("TEST");
});
it("define rules option", () => {
Expand All @@ -119,7 +119,7 @@ describe("error tests", () => {
expect(() =>
parser.parse(md, {
from: "markdown.md",
})
}),
).to.throw("Unknown word");
});
it("define syntax option", () => {
Expand All @@ -135,7 +135,7 @@ describe("error tests", () => {
expect(() =>
parser.parse(md, {
from: "markdown.md",
})
}),
).to.throw('Cannot resolve module "postcss-foo"');
});
});
4 changes: 2 additions & 2 deletions test/integration/autoprefixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ chai.use(jestSnapshotPlugin());

const FIXTURE_ROOT = path.resolve(
__dirname,
"../../test-fixtures/integration/autoprefixer"
"../../test-fixtures/integration/autoprefixer",
);

describe("Integration with autoprefixer", () => {
Expand All @@ -24,7 +24,7 @@ describe("Integration with autoprefixer", () => {
.then(function (result) {
const actual = result.content;
chai.expect(actual).toMatchSnapshot();
})
}),
);
});
}
Expand Down
6 changes: 3 additions & 3 deletions test/integration/stylelint.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ chai.use(jestSnapshotPlugin());

const FIXTURE_ROOT = path.resolve(
__dirname,
"../../test-fixtures/integration/stylelint"
"../../test-fixtures/integration/stylelint",
);

describe("Integration with stylelint", () => {
Expand All @@ -29,7 +29,7 @@ describe("Integration with stylelint", () => {
.then((result) => {
const actual = result.results[0].warnings;
chai.expect(actual).toMatchSnapshot();
})
}),
);
});
describe(`stylelint --fix with markdown`, () => {
Expand All @@ -45,7 +45,7 @@ describe("Integration with stylelint", () => {
.then((result) => {
const actual = result.output;
chai.expect(actual).toMatchSnapshot();
})
}),
);
});
}
Expand Down
2 changes: 1 addition & 1 deletion test/root.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("Root node tests", () => {
" .c",
" color red",
"",
].join("\n")
].join("\n"),
);
});
});
2 changes: 1 addition & 1 deletion test/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function* listupFixtures(rootDir) {
const filepath = path.join(rootDir, filename);
if (fs.statSync(filepath).isDirectory()) {
for (const { filepath: childFilepath, content } of listupFixtures(
filepath
filepath,
)) {
yield {
filename: childFilepath.slice(rootDir.length),
Expand Down

0 comments on commit 65ef1b6

Please sign in to comment.