Skip to content

Commit 369957c

Browse files
committed
build: reformat docs site code
Currently Prettier will complain for any docs site file we change since it was never reformatted. These changes update the formatting.
1 parent 73022d8 commit 369957c

File tree

127 files changed

+679
-874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+679
-874
lines changed

material.angular.io/.eslintrc.json

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
{
22
"root": true,
3-
"ignorePatterns": [
4-
"*.d.ts",
5-
"src/assets/stack-blitz/**/*.ts"
6-
],
3+
"ignorePatterns": ["*.d.ts", "src/assets/stack-blitz/**/*.ts"],
74
"overrides": [
85
{
9-
"files": [
10-
"*.ts"
11-
],
12-
"plugins": [
13-
"@stylistic",
14-
"@typescript-eslint",
15-
"ban"
16-
],
6+
"files": ["*.ts"],
7+
"plugins": ["@stylistic", "@typescript-eslint", "ban"],
178
"parserOptions": {
18-
"project": [
19-
"tsconfig.json",
20-
"e2e/tsconfig.json"
21-
],
9+
"project": ["tsconfig.json", "e2e/tsconfig.json"],
2210
"createDefaultProgram": true
2311
},
2412
"extends": [
@@ -53,28 +41,11 @@
5341
"allowTemplateLiterals": true
5442
}
5543
],
56-
"@stylistic/semi": [
57-
"error"
58-
],
59-
"arrow-parens": [
60-
"off",
61-
"always"
62-
],
63-
"brace-style": [
64-
"error",
65-
"1tbs"
66-
],
44+
"@stylistic/semi": ["error"],
45+
"arrow-parens": ["off", "always"],
46+
"brace-style": ["error", "1tbs"],
6747
"import/order": "off",
68-
"linebreak-style": [
69-
"error",
70-
"unix"
71-
],
72-
"max-len": [
73-
"error",
74-
{
75-
"code": 100
76-
}
77-
],
48+
"linebreak-style": ["error", "unix"],
7849
"ban/ban": [
7950
"error",
8051
{
@@ -90,10 +61,7 @@
9061
"name": "xdescribe"
9162
},
9263
{
93-
"name": [
94-
"Object",
95-
"assign"
96-
],
64+
"name": ["Object", "assign"],
9765
"message": "Use the spread operator instead."
9866
}
9967
],
@@ -107,12 +75,8 @@
10775
}
10876
},
10977
{
110-
"files": [
111-
"*.html"
112-
],
113-
"extends": [
114-
"plugin:@angular-eslint/template/recommended"
115-
],
78+
"files": ["*.html"],
79+
"extends": ["plugin:@angular-eslint/template/recommended"],
11680
"rules": {
11781
"@angular-eslint/template/accessibility-alt-text": "error",
11882
"@angular-eslint/template/accessibility-elements-content": "error",

material.angular.io/BUILD.bazel

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -12,56 +12,54 @@ npm_link_all_packages(name = "node_modules")
1212
copy_to_bin(
1313
name = "ng-base-config",
1414
srcs = [
15-
"angular.json",
16-
"tsconfig.json",
17-
"package.json",
15+
"angular.json",
16+
"package.json",
17+
"tsconfig.json",
1818
],
1919
)
2020

2121
# Test config files
2222
copy_to_bin(
23-
name = "ng-base-test-config",
24-
srcs = [
25-
"karma-custom-launchers.js",
26-
],
23+
name = "ng-base-test-config",
24+
srcs = [
25+
"karma-custom-launchers.js",
26+
],
2727
)
2828

2929
# Lint config files
3030
copy_to_bin(
31-
name = "ng-base-lint-config",
32-
srcs = [
33-
".eslintrc.json",
34-
],
31+
name = "ng-base-lint-config",
32+
srcs = [
33+
".eslintrc.json",
34+
],
3535
)
3636

37-
3837
# The main application
3938
ng_app(
4039
name = "app",
4140
project_name = "material-angular-io",
4241
deps = [
43-
"//:node_modules/@angular/components-examples",
44-
"//:node_modules/@stackblitz/sdk",
45-
"//:node_modules/path-normalize",
46-
"//:node_modules/moment",
42+
"//:node_modules/@angular/components-examples",
43+
"//:node_modules/@stackblitz/sdk",
44+
"//:node_modules/moment",
45+
"//:node_modules/path-normalize",
4746
],
4847
)
4948

50-
5149
js_test(
52-
name = "audit",
53-
entry_point = "tools/audit-docs.js",
54-
args = [
55-
"$(location //:build.production)",
56-
],
57-
data = [
58-
"tools/lighthouse-audit.mjs",
59-
"//:build.production",
60-
"//:node_modules/lighthouse",
61-
"//:node_modules/lighthouse-logger",
62-
"//:node_modules/puppeteer",
63-
"//:node_modules/shelljs",
64-
"//:node_modules/light-server",
65-
],
66-
tags = ["audit"],
50+
name = "audit",
51+
args = [
52+
"$(location //:build.production)",
53+
],
54+
data = [
55+
"tools/lighthouse-audit.mjs",
56+
"//:build.production",
57+
"//:node_modules/light-server",
58+
"//:node_modules/lighthouse",
59+
"//:node_modules/lighthouse-logger",
60+
"//:node_modules/puppeteer",
61+
"//:node_modules/shelljs",
62+
],
63+
entry_point = "tools/audit-docs.js",
64+
tags = ["audit"],
6765
)

material.angular.io/defs.bzl

Lines changed: 41 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ APPLICATION_CONFIG = COMMON_CONFIG + [
5555
TEST_CONFIG = COMMON_CONFIG + [
5656
"@dev-infra//bazel/browsers/chromium",
5757
"@dev-infra//bazel/browsers/firefox",
58-
5958
"//:ng-base-test-config",
6059
":ng-test-config",
6160
"//:node_modules/karma",
@@ -76,7 +75,6 @@ TEST_DEPS = [
7675
E2E_CONFIG = COMMON_CONFIG + [
7776
"@dev-infra//bazel/browsers/chromium",
7877
"@dev-infra//bazel/browsers/firefox",
79-
8078
"//:ng-base-test-config",
8179
":ng-e2e-config",
8280
"//:node_modules/jasmine-spec-reporter",
@@ -89,28 +87,27 @@ E2E_DEPS = [
8987
]
9088

9189
LINT_CONFIG = COMMON_CONFIG + [
92-
# Lint uses the e2e config
93-
"//:ng-base-test-config",
94-
":ng-e2e-config",
95-
"//:ng-base-lint-config",
96-
"//:node_modules/@angular-eslint/builder",
97-
"//:node_modules/@angular-eslint/eslint-plugin",
98-
"//:node_modules/@angular-eslint/eslint-plugin-template",
99-
"//:node_modules/@angular-eslint/template-parser",
100-
"//:node_modules/eslint-plugin-ban",
101-
"//:node_modules/eslint-plugin-import",
102-
"//:node_modules/eslint-plugin-jsdoc",
103-
"//:node_modules/eslint-plugin-prefer-arrow",
104-
"//:node_modules/@typescript-eslint/eslint-plugin",
105-
"//:node_modules/@typescript-eslint/parser",
106-
"//:node_modules/@stylistic/eslint-plugin",
90+
# Lint uses the e2e config
91+
"//:ng-base-test-config",
92+
":ng-e2e-config",
93+
"//:ng-base-lint-config",
94+
"//:node_modules/@angular-eslint/builder",
95+
"//:node_modules/@angular-eslint/eslint-plugin",
96+
"//:node_modules/@angular-eslint/eslint-plugin-template",
97+
"//:node_modules/@angular-eslint/template-parser",
98+
"//:node_modules/eslint-plugin-ban",
99+
"//:node_modules/eslint-plugin-import",
100+
"//:node_modules/eslint-plugin-jsdoc",
101+
"//:node_modules/eslint-plugin-prefer-arrow",
102+
"//:node_modules/@typescript-eslint/eslint-plugin",
103+
"//:node_modules/@typescript-eslint/parser",
104+
"//:node_modules/@stylistic/eslint-plugin",
107105
]
108106
LINT_DEPS = [
109-
# TODO(bazel): this should be included as a transitive of @angular-devkit/architect-cli!?
110-
"//:node_modules/@angular-devkit/architect",
107+
# TODO(bazel): this should be included as a transitive of @angular-devkit/architect-cli!?
108+
"//:node_modules/@angular-devkit/architect",
111109
]
112110

113-
114111
def ng_app(name, project_name = None, deps = [], test_deps = [], e2e_deps = [], **kwargs):
115112
"""
116113
Macro for Angular applications, creating various targets aligning with the Angular CLI.
@@ -137,44 +134,44 @@ def ng_app(name, project_name = None, deps = [], test_deps = [], e2e_deps = [],
137134

138135
test_srcs = native.glob(["src/test.ts", "src/**/*.spec.ts"])
139136

140-
e2e_srcs = native.glob(["e2e/src/**/*.ts"])
137+
e2e_srcs = native.glob(["e2e/src/**/*.ts"])
141138

142139
tags = kwargs.pop("tags", [])
143140

144141
# config files
145142
copy_to_bin(
146143
name = "ng-app-config",
147144
srcs = [
148-
"tsconfig.app.json",
145+
"tsconfig.app.json",
149146
],
150147
visibility = ["//visibility:private"],
151148
)
152149
copy_to_bin(
153150
name = "ng-test-config",
154151
srcs = [
155-
"karma.conf.js",
156-
"tsconfig.spec.json",
152+
"karma.conf.js",
153+
"tsconfig.spec.json",
157154
],
158155
visibility = ["//visibility:private"],
159156
)
160157
copy_to_bin(
161158
name = "ng-e2e-config",
162159
srcs = [
163-
"e2e/tsconfig.json",
164-
"e2e/protractor.conf.js",
160+
"e2e/tsconfig.json",
161+
"e2e/protractor.conf.js",
165162
],
166163
visibility = ["//visibility:private"],
167164
)
168165

169166
# Lint config files in addition to the root
170-
if native.package_name() != '':
171-
copy_to_bin(
172-
name = "lint-config",
173-
srcs = [
174-
".eslintrc.json",
175-
],
176-
visibility = ["//visibility:private"],
177-
)
167+
if native.package_name() != "":
168+
copy_to_bin(
169+
name = "lint-config",
170+
srcs = [
171+
".eslintrc.json",
172+
],
173+
visibility = ["//visibility:private"],
174+
)
178175

179176
project_name = project_name if project_name else name
180177

@@ -239,7 +236,7 @@ def ng_app(name, project_name = None, deps = [], test_deps = [], e2e_deps = [],
239236
_architect_test(
240237
project_name,
241238
"lint",
242-
srcs = srcs + test_srcs + e2e_srcs + deps + test_deps + NG_COMMON_DEPS + LINT_DEPS + LINT_CONFIG + ([":lint-config"] if native.package_name() != '' else []),
239+
srcs = srcs + test_srcs + e2e_srcs + deps + test_deps + NG_COMMON_DEPS + LINT_DEPS + LINT_CONFIG + ([":lint-config"] if native.package_name() != "" else []),
243240
tags = tags + ["lint"],
244241
**kwargs
245242
)
@@ -248,8 +245,9 @@ def _architect_build(project_name, configuration = None, args = [], srcs = [], *
248245
output_dir = "%s%s" % (project_name, ".%s" % configuration if configuration else "")
249246

250247
args = [
251-
"%s:build%s" % (project_name, ":%s" % configuration if configuration else ""),
252-
"--output-path", output_dir
248+
"%s:build%s" % (project_name, ":%s" % configuration if configuration else ""),
249+
"--output-path",
250+
output_dir,
253251
] + args
254252

255253
architect_cli.architect(
@@ -258,13 +256,13 @@ def _architect_build(project_name, configuration = None, args = [], srcs = [], *
258256
args = args,
259257
out_dirs = [output_dir],
260258
srcs = srcs,
261-
**kwargs,
259+
**kwargs
262260
)
263261

264262
def _architect_test(project_name, command, configuration = None, args = [], srcs = [], **kwargs):
265263
to_root = ""
266264
if native.package_name() != "":
267-
to_root = "".join(["../" for _ in native.package_name().split("/")])
265+
to_root = "".join(["../" for _ in native.package_name().split("/")])
268266

269267
env = {
270268
"CHROME_BIN": to_root + "$(CHROMIUM)",
@@ -275,25 +273,24 @@ def _architect_test(project_name, command, configuration = None, args = [], srcs
275273
name = "%s%s" % (command, ".%s" % configuration if configuration else ""),
276274
chdir = native.package_name(),
277275
args = [
278-
"%s:%s%s" % (project_name, command, ":%s" % configuration if configuration else "")
276+
"%s:%s%s" % (project_name, command, ":%s" % configuration if configuration else ""),
279277
] + args,
280278
data = srcs,
281279
env = env,
282280
toolchains = [
283281
"@dev-infra//bazel/browsers/chromium:toolchain_alias",
284282
"@dev-infra//bazel/browsers/firefox:toolchain_alias",
285283
],
286-
**kwargs,
284+
**kwargs
287285
)
288286

289287
def _architect_binary(project_name, command, configuration = None, args = [], srcs = [], **kwargs):
290288
architect_cli.architect_binary(
291289
name = "%s%s" % (command, ".%s" % configuration if configuration else ""),
292290
chdir = native.package_name(),
293291
args = [
294-
"%s:%s%s" % (project_name, command, ":%s" % configuration if configuration else "")
292+
"%s:%s%s" % (project_name, command, ":%s" % configuration if configuration else ""),
295293
] + args,
296294
data = srcs,
297-
**kwargs,
295+
**kwargs
298296
)
299-

0 commit comments

Comments
 (0)