Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ng-dev/format): support mjs and cjs files with prettier and clang-format #274

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ http_archive(
load("@build_bazel_rules_nodejs//:index.bzl", "node_repositories", "yarn_install")

node_repositories(
use_nvmrc = "//:.nvmrc",
node_version = "16.10.0",
)

yarn_install(
Expand Down
2 changes: 1 addition & 1 deletion ng-dev/format/formatters/clang-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class ClangFormat extends Formatter {

override binaryFilePath = join(this.git.baseDir, 'node_modules/.bin/clang-format');

override defaultFileMatcher = ['**/*.{t,j}s'];
override defaultFileMatcher = ['**/*.{t,j,cj,mj}s'];

override actions = {
check: {
Expand Down
2 changes: 1 addition & 1 deletion ng-dev/format/formatters/prettier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class Prettier extends Formatter {

override binaryFilePath = join(this.git.baseDir, 'node_modules/.bin/prettier');

override defaultFileMatcher = ['**/*.{t,j}s'];
override defaultFileMatcher = ['**/*.{t,j,cj,mj}s'];

/**
* The configuration path of the prettier config, obtained during construction to prevent needing
Expand Down
4 changes: 2 additions & 2 deletions tools/local-actions/changelog/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -45296,7 +45296,7 @@ var require_clang_format = __commonJS({
super(...arguments);
this.name = "clang-format";
this.binaryFilePath = (0, path_12.join)(this.git.baseDir, "node_modules/.bin/clang-format");
this.defaultFileMatcher = ["**/*.{t,j}s"];
this.defaultFileMatcher = ["**/*.{t,j,cj,mj}s"];
this.actions = {
check: {
commandFlags: `--Werror -n -style=file`,
Expand Down Expand Up @@ -45338,7 +45338,7 @@ var require_prettier = __commonJS({
super(...arguments);
this.name = "prettier";
this.binaryFilePath = (0, path_12.join)(this.git.baseDir, "node_modules/.bin/prettier");
this.defaultFileMatcher = ["**/*.{t,j}s"];
this.defaultFileMatcher = ["**/*.{t,j,cj,mj}s"];
this.configPath = this.config["prettier"] ? (0, child_process_1.spawnSync)(this.binaryFilePath, ["--find-config-path", "."]).stdout.trim() : "";
this.actions = {
check: {
Expand Down