Skip to content

Commit

Permalink
chore: remove trailing whitespaces for all files; add editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jun 12, 2024
1 parent f6752b4 commit f955a4d
Show file tree
Hide file tree
Showing 16 changed files with 45 additions and 49 deletions.
2 changes: 2 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
trim_trailing_whitespace = true
insert_final_newline = true
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/partial_loader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub const LINT_PARTIAL_LOADER_EXT: &[&str] = &["vue", "astro", "svelte"];
pub struct JavaScriptSource<'a> {
pub source_text: &'a str,
pub source_type: SourceType,
/// The javascript source could be embedded in some file,
/// The javascript source could be embedded in some file,
/// use `start` to record start offset of js block in the original file.
pub start: usize,
}
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_linter/src/rules/react/no_find_dom_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fn test() {
render: function() {
return <div>Hello</div>;
}
});
});
",
None,
),
Expand Down Expand Up @@ -189,7 +189,7 @@ fn test() {
render() {
return <div>Hello</div>;
}
}
}
",
None,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fn test() {
interface Foo {
props: string;
}
function bar() {
return class Foo {};
}
Expand All @@ -137,7 +137,7 @@ fn test() {
interface Foo {
props: string;
}
(function bar() {
class Foo {}
})();
Expand All @@ -149,7 +149,7 @@ fn test() {
declare global {
interface Foo {}
}
class Foo {}
",
None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,12 @@ fn test() {
element.removeEventListener("glider-refresh", event => {
// $ExpectType GliderEvent<undefined>
event;
// $ExpectType boolean
event.bubbles;
event.target;
if (event.target) {
// $ExpectType Glider<HTMLElement> | undefined
event.target._glider;
Expand All @@ -186,12 +186,12 @@ fn test() {
element.removeEventListener("glider-refresh", function (event) {
// $ExpectType GliderEvent<undefined>
event;
// $ExpectType boolean
event.bubbles;
event.target;
if (event.target) {
// $ExpectType Glider<HTMLElement> | undefined
event.target._glider;
Expand Down
1 change: 0 additions & 1 deletion crates/oxc_linter/src/snapshots/jsx_key.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 161
expression: jsx_key
---
eslint-plugin-react(jsx-key): Missing "key" prop for element in array.
Expand Down
1 change: 0 additions & 1 deletion crates/oxc_linter/src/snapshots/max_nested_describe.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 203
expression: max_nested_describe
---
eslint-plugin-jest(max-nested-describe): Enforces a maximum depth to nested describe calls.
Expand Down
1 change: 0 additions & 1 deletion crates/oxc_linter/src/snapshots/no_duplicate_hooks.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 162
expression: no_duplicate_hooks
---
eslint-plugin-jest(no-duplicate-hooks): Disallow duplicate setup and teardown hooks.
Expand Down
1 change: 0 additions & 1 deletion crates/oxc_linter/src/snapshots/prefer_hooks_on_top.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 161
expression: prefer_hooks_on_top
---
eslint-plugin-jest(prefer-hooks-on-top): Suggest having hooks before any test cases.
Expand Down
1 change: 0 additions & 1 deletion crates/oxc_linter/src/snapshots/require_hook.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
source: crates/oxc_linter/src/tester.rs
assertion_line: 157
expression: require_hook
---
eslint-plugin-jest(require-hook): Require setup and teardown code to be within a hook.
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_semantic/src/jsdoc/parser/jsdoc_parts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ mod test {
(
"
extra text
*
*
",
"extra text",
),
Expand Down
4 changes: 2 additions & 2 deletions crates/oxc_traverse/scripts/lib/parse.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function parseStruct(name, rawName, lines, scopeArgs, filename, startLineIndex)
const [, rawName, name, rawTypeName] = match,
typeName = rawTypeName.replace(/<'a>/g, '').replace(/<'a, ?/g, '<'),
{name: innerTypeName, wrappers} = typeAndWrappers(typeName);

fields.push({name, typeName, rawName, rawTypeName, innerTypeName, wrappers});
}
return {kind: 'struct', name, rawName, fields, scopeArgs};
Expand Down Expand Up @@ -144,7 +144,7 @@ function parseScopeArgs(argsStr, filename, lineIndex) {
}
}
assert(bracketCount === 0);

args[key] = argsStr.slice(0, index).trim();
argsStr = argsStr.slice(index + 1);
if (argsStr === '') break;
Expand Down
35 changes: 17 additions & 18 deletions tasks/coverage/parser_typescript.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6572,7 +6572,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
× TS1108: A 'return' statement can only be used within a function body
╭─[compiler/fileWithNextLine3.ts:3:1]
2 │ // 0. It should be counted as a space and should not trigger ASI
3 │ return…0;
3 │ return…0;
· ──────
╰────

Expand Down Expand Up @@ -6731,9 +6731,9 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
╰────

× Unexpected token
╭─[compiler/incompleteDottedExpressionAtEOF.ts:2:18]
╭─[compiler/incompleteDottedExpressionAtEOF.ts:2:17]
1 │ // used to leak __missing into error message
2 │ var p2 = window.
2 │ var p2 = window.
╰────

× Expected `,` but found `;`
Expand Down Expand Up @@ -8695,7 +8695,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"

× Unexpected token
╭─[compiler/restArgMissingName.ts:1:18]
1 │ function sum (...) {}
1 │ function sum (...) {}
· ─
╰────

Expand Down Expand Up @@ -9819,14 +9819,14 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
× Unexpected token
╭─[compiler/taggedTemplatesWithIncompleteTemplateExpressions4.ts:5:24]
4 │ // Incomplete call, but too many parameters.
5 │ f `123qdawdrqw${ 1 }${ }${
5 │ f `123qdawdrqw${ 1 }${ }${
· ─
╰────

× Expected `$}` but found `EOF`
╭─[compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts:5:30]
╭─[compiler/taggedTemplatesWithIncompleteTemplateExpressions5.ts:5:29]
4 │ // Incomplete call, but too many parameters.
5 │ f `123qdawdrqw${ 1 }${ 2 }${
5 │ f `123qdawdrqw${ 1 }${ 2 }${
╰────

× Expected `$}` but found `EOF`
Expand Down Expand Up @@ -10570,8 +10570,8 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"

× Constructor can't be an async method
╭─[conformance/async/es6/asyncConstructor_es6.ts:2:9]
1 │ class C {
2 │ async constructor() {
1 │ class C {
2 │ async constructor() {
· ───────────
3 │ }
╰────
Expand Down Expand Up @@ -13182,8 +13182,8 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
╰────

× Expected `$}` but found `EOF`
╭─[conformance/es6/templates/TemplateExpression1.ts:1:19]
1 │ var v = `foo ${ a
╭─[conformance/es6/templates/TemplateExpression1.ts:1:18]
1 │ var v = `foo ${ a
╰────

× 'super' can only be used with function calls or in property accesses
Expand Down Expand Up @@ -16352,7 +16352,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"

× Expected `,` but found `float`
╭─[conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression2.ts:3:2]
2 │
2 │
3 │ .7042760848999023, 1.1955541372299194, 0.19600726664066315, -0.7120069861412048];
· ────────┬────────
· ╰── `,` expected
Expand Down Expand Up @@ -17483,20 +17483,19 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"

× Invalid Unicode escape sequence
╭─[conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens11.ts:1:4]
1 │ ; \ \ \
1 │ ; \ \ \
· ─
╰────

× Invalid Unicode escape sequence
╭─[conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens11.ts:1:6]
1 │ ; \ \ \
1 │ ; \ \ \
· ─
╰────

× Invalid Unicode escape sequence
╭─[conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens11.ts:1:8]
1 │ ; \ \ \
· ─
1 │ ; \ \ \
╰────

× Invalid Unicode escape sequence
Expand Down Expand Up @@ -18335,7 +18334,7 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
× Expected `,` but found `?`
╭─[conformance/parser/ecmascript6/ShorthandPropertyAssignment/parserShorthandPropertyAssignment5.ts:2:18]
1 │ var greet = "hello";
2 │ var obj = { greet? };
2 │ var obj = { greet? };
· ┬
· ╰── `,` expected
╰────
Expand Down Expand Up @@ -20420,5 +20419,5 @@ Expect to Parse: "conformance/salsa/plainJSRedeclare3.ts"
╭─[conformance/types/typeParameters/typeParameterLists/varianceAnnotationsWithCircularlyReferencesError.ts:1:12]
1 │ type T1<in in> = T1 // Error: circularly references
· ──
2 │ type T2<out out> = T2 // Error: circularly references
2 │ type T2<out out> = T2 // Error: circularly references
╰────
14 changes: 7 additions & 7 deletions tasks/minsize/minsize.snap
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
Original -> Minified -> Gzip
Original -> Minified -> Gzip
72.14 kB -> 39.58 kB -> 10.83 kB react.development.js

173.90 kB -> 95.37 kB -> 24.37 kB moment.js
173.90 kB -> 95.37 kB -> 24.37 kB moment.js

287.63 kB -> 140.16 kB -> 39.82 kB jquery.js
287.63 kB -> 140.16 kB -> 39.82 kB jquery.js

342.15 kB -> 189.85 kB -> 55.32 kB vue.js
342.15 kB -> 189.85 kB -> 55.32 kB vue.js

544.10 kB -> 144.63 kB -> 35.31 kB lodash.js
544.10 kB -> 144.63 kB -> 35.31 kB lodash.js

555.77 kB -> 390.47 kB -> 102.94 kB d3.js
555.77 kB -> 390.47 kB -> 102.94 kB d3.js

977.19 kB -> 603.47 kB -> 138.53 kB bundle.min.js

1.25 MB -> 929.41 kB -> 189.96 kB three.js
1.25 MB -> 929.41 kB -> 189.96 kB three.js

2.14 MB -> 1.41 MB -> 217.64 kB victory.js

Expand Down
2 changes: 1 addition & 1 deletion tasks/transform_conformance/typescript.snap.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ var E = (E => {
× Expected `,` but found `;`
╭─[typescript/tests/cases/conformance/enums/enumErrors.ts:48:18]
47 │
47 │
48 │ postSemicolon;
· ┬
· ╰── `,` expected
Expand Down
6 changes: 3 additions & 3 deletions website/playground/symbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
*/
let cacheSymbols = null
/**
*
* @param {SymbolTable} symbols
* @returns
*
* @param {SymbolTable} symbols
* @returns
*/
export const renderSymbols = (symbols) => {
const target = []
Expand Down

0 comments on commit f955a4d

Please sign in to comment.