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 35e267b commit d77ec9f
Show file tree
Hide file tree
Showing 15 changed files with 28 additions and 31 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
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 d77ec9f

Please sign in to comment.