Skip to content

Commit 2081cb9

Browse files
authored
build: reformat docs site code (#30418)
Currently Prettier will complain for any docs site file we change since it was never reformatted. These changes update the formatting.
1 parent 9ea468a commit 2081cb9

File tree

126 files changed

+638
-830
lines changed

Some content is hidden

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

126 files changed

+638
-830
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/e2e/protractor.conf.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,18 @@ const path = require('path');
88
// TODO(bazel): drop non-bazel
99
const isBazel = !!process.env['TEST_TARGET'];
1010
if (isBazel) {
11-
// Resolve CHROME_BIN and CHROMEDRIVER_BIN from relative paths to absolute paths within the
12-
// runfiles tree so that subprocesses spawned in a different working directory can still find them.
13-
process.env.CHROME_BIN = path.resolve(process.env.CHROME_BIN);
14-
process.env.CHROMEDRIVER_BIN = path.resolve(process.env.CHROMEDRIVER_BIN);
11+
// Resolve CHROME_BIN and CHROMEDRIVER_BIN from relative paths to absolute paths within the
12+
// runfiles tree so that subprocesses spawned in a different working directory can still find them.
13+
process.env.CHROME_BIN = path.resolve(process.env.CHROME_BIN);
14+
process.env.CHROMEDRIVER_BIN = path.resolve(process.env.CHROMEDRIVER_BIN);
1515
}
1616

1717
/**
1818
* @type { import("protractor").Config }
1919
*/
2020
const config = {
2121
allScriptsTimeout: 11000,
22-
specs: [
23-
'./src/**/*.e2e-spec.ts'
24-
],
22+
specs: ['./src/**/*.e2e-spec.ts'],
2523
chromeDriver: process.env.CHROMEDRIVER_BIN,
2624
capabilities: {
2725
'browserName': 'chrome',
@@ -37,24 +35,24 @@ const config = {
3735
'--hide-scrollbars',
3836
'--mute-audio',
3937
],
40-
}
38+
},
4139
},
4240
directConnect: true,
4341
baseUrl: 'http://localhost:4200/',
4442
framework: 'jasmine',
4543
jasmineNodeOpts: {
4644
showColors: true,
4745
defaultTimeoutInterval: 30000,
48-
print: function() {}
46+
print: function () {},
4947
},
5048
onPrepare() {
5149
if (!isBazel) {
5250
require('ts-node').register({
53-
project: require('path').join(__dirname, './tsconfig.json')
51+
project: require('path').join(__dirname, './tsconfig.json'),
5452
});
5553
}
5654
jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}}));
57-
}
55+
},
5856
};
5957

6058
if (isBazel) {
@@ -70,7 +68,7 @@ if (process.env['TRAVIS']) {
7068

7169
'tunnel-identifier': process.env['TRAVIS_JOB_NUMBER'],
7270
'build': process.env['TRAVIS_JOB_NUMBER'],
73-
'name': 'Material Docs E2E'
71+
'name': 'Material Docs E2E',
7472
};
7573
}
7674

material.angular.io/e2e/src/app.e2e-spec.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ describe('Material Docs App', () => {
1616
afterEach(async () => {
1717
// Assert that there are no errors emitted from the browser
1818
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19-
expect(logs).not.toContain(jasmine.objectContaining({
20-
level: logging.Level.SEVERE,
21-
} as logging.Entry));
19+
expect(logs).not.toContain(
20+
jasmine.objectContaining({
21+
level: logging.Level.SEVERE,
22+
} as logging.Entry),
23+
);
2224
});
2325
});

material.angular.io/e2e/src/app.po.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export class MaterialDocsAppPage {
66
}
77

88
getTitleText() {
9-
return element(by.css('app-homepage header .docs-header-headline .mat-h1'))
10-
.getText() as Promise<string>;
9+
return element(
10+
by.css('app-homepage header .docs-header-headline .mat-h1'),
11+
).getText() as Promise<string>;
1112
}
1213
}

material.angular.io/e2e/tsconfig.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
"outDir": "../out-tsc/e2e",
55
"module": "commonjs",
66
"target": "es5",
7-
"types": [
8-
"jasmine",
9-
"jasminewd2",
10-
"node"
11-
]
7+
"types": ["jasmine", "jasminewd2", "node"]
128
}
139
}

material.angular.io/karma-custom-launchers.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,19 @@ exports.customLaunchers = {
1111
'--disable-gpu',
1212
'--disable-dev-shm-usage',
1313
'--hide-scrollbars',
14-
'--mute-audio'
14+
'--mute-audio',
1515
],
1616
},
1717
ChromeHeadlessLocal: {
1818
base: 'ChromeHeadless',
19-
flags: [
20-
'--window-size=1024,768'
21-
]
19+
flags: ['--window-size=1024,768'],
2220
},
2321
ChromeHeadlessCI: {
2422
base: 'ChromeHeadless',
25-
flags: [
26-
'--window-size=1024,768',
27-
'--no-sandbox'
28-
]
23+
flags: ['--window-size=1024,768', '--no-sandbox'],
2924
},
3025
FirefoxHeadless: {
3126
base: 'Firefox',
32-
flags: [
33-
'-headless'
34-
]
27+
flags: ['-headless'],
3528
},
3629
};

material.angular.io/karma.conf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ module.exports = function (config) {
2525
require('@angular-devkit/build-angular/plugins/karma'),
2626
],
2727
client: {
28-
clearContext: false // leave Jasmine Spec Runner output visible in browser
28+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
2929
},
3030
coverageIstanbulReporter: {
3131
dir: require('path').join(__dirname, 'coverage'),
3232
reports: ['html', 'lcovonly', 'text-summary'],
33-
fixWebpackSourcePaths: true
33+
fixWebpackSourcePaths: true,
3434
},
3535
reporters: ['progress', 'kjhtml'],
3636
port: 9876,
@@ -43,6 +43,6 @@ module.exports = function (config) {
4343
});
4444

4545
if (process.env['TRAVIS']) {
46-
config.browsers = [isBazel ? 'ChromeHeadlessNoSandbox' : 'ChromeHeadlessCI', 'FirefoxHeadless']
46+
config.browsers = [isBazel ? 'ChromeHeadlessNoSandbox' : 'ChromeHeadlessCI', 'FirefoxHeadless'];
4747
}
4848
};

material.angular.io/scenes/BUILD.bazel

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ package(default_visibility = ["//visibility:public"])
66
ng_app(
77
name = "scenes",
88
deps = [
9-
"//:node_modules/@angular/components-examples",
10-
"//:node_modules/@stackblitz/sdk",
11-
"//:node_modules/moment",
9+
"//:node_modules/@angular/components-examples",
10+
"//:node_modules/@stackblitz/sdk",
11+
"//:node_modules/moment",
1212
],
1313
)

0 commit comments

Comments
 (0)