Skip to content

Commit

Permalink
prettier fix for next-swc
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Apr 3, 2023
1 parent aeec6b5 commit 1fbaf44
Show file tree
Hide file tree
Showing 409 changed files with 4,911 additions and 4,881 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ lerna.json
.github/actions/next-stats-action/.work
.github/actions/issue-validator/index.mjs
.github/actions/issue-labeler/lib/index.js
packages/next-swc/crates/**/*
packages/next-swc/crates/next-core/js/src/compiled/**/*
packages/next-swc/crates/**/tests/**/output*
packages/next-swc/target/**/*
packages/next-swc/native/**/*
packages/next-codemod/transforms/__testfixtures__/**/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import dynamic from 'next/dynamic'
const DynamicComponentWithCustomLoading = dynamic(
() => import('../components/hello'),
{ loading: () => <p>...</p> },
"3rd"
'3rd'
)
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
const getStaticProps = async () => {}
export { a as getServerSideProps }

export { a as getServerSideProps }
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
export { a as getServerSideProps } from './input'
export { getStaticPaths } from 'a'


Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// This is a comment.

"use strict";
'use strict'

/**
* This is a comment.
*/

import "client-only"
import 'client-only'

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export function getServerSideProps (){
}
export function getServerSideProps() {}

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export function getStaticProps (){
}
export function getStaticProps() {}

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// This is a comment.

"use strict";
'use strict'

/**
* This is a comment.
*/

import "server-only"
import 'server-only'

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import "react"

"use client"
import 'react'
;('use client')

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// This is a comment.

"use strict";
'use strict'

/**
* This is a comment.
*/

import "client-only"
import 'client-only'

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export function getServerSideProps (){
}
export function getServerSideProps() {}

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export function getStaticProps (){
}
export function getStaticProps() {}

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import { createContext } from 'react'
import { useEffect, useImperativeHandle } from 'react'

import {
Component,
createFactory,
PureComponent,
Component,
createFactory,
PureComponent,
useDeferredValue,
useInsertionEffect,
useLayoutEffect,
useReducer,
useRef,
useSyncExternalStore
} from "react"
useInsertionEffect,
useLayoutEffect,
useReducer,
useRef,
useSyncExternalStore,
} from 'react'

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import {
findDOMNode,
flushSync,
unstable_batchedUpdates,
} from "react-dom"
import { findDOMNode, flushSync, unstable_batchedUpdates } from 'react-dom'

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// This is a comment.

"use strict";
'use strict'

/**
* This is a comment.
*/

import "react-dom/server"
import 'react-dom/server'

import "react-dom/client"
import 'react-dom/client'

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use server';
'use server'

export function foo() {}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use sevrer'

export async function foo () {}
export async function foo() {}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'react'

('use sevrer')
;('use sevrer')

// ^Tools like Prettier sometimes do this.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
'use strict'

// comment

'use server';
'use server'

export function bar() {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use server';
'use server'

export const x = 1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use server';
'use server'

export default class Component {
render() {
return null;
return null
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use server';
'use server'

export * from 'foo'
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
'use server';
'use server'

export default () => {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ const foo = async () => {

const bar = async () => {
const x = 1
'use server'
;('use server')
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
import 'my-module'

'use server'
;('use server')
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import dynamic from 'next/dynamic'
const DynamicComponent = dynamic(() => import(`../components/hello`))

const componentRoot = '@/some-components'
const Component1 = dynamic(() => import(`${componentRoot}/component1`));
const Component2 = dynamic(() => import(`${componentRoot}/component2`));
const Component1 = dynamic(() => import(`${componentRoot}/component1`))
const Component2 = dynamic(() => import(`${componentRoot}/component2`))
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import dynamic from 'next/dynamic'
const DynamicComponent = dynamic(() => handleImport(import('./components/hello')), {
loading: () => null,
ssr: false,
});
const DynamicComponent = dynamic(
() => handleImport(import('./components/hello')),
{
loading: () => null,
ssr: false,
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ function About(props) {
return <h3>My AMP About Page!</h3>
}

export default About
export default About
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ function About(props) {
return <h3>My AMP About Page!</h3>
}

export default About
export default About
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export default function Home() {
return <div data-test-id="1" data-custom="1a">
<div data-custom="2">
<h1 data-testid="3">Hello World!</h1>
return (
<div data-test-id="1" data-custom="1a">
<div data-custom="2">
<h1 data-testid="3">Hello World!</h1>
</div>
</div>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
export default function Home() {
return <div data-test-id="1" data-custom="1a">
<div data-custom="2">
<h1 data-testid="3" nested={() => (<div data-testid="4">nested</div>)}>Hello World!</h1>
return (
<div data-test-id="1" data-custom="1a">
<div data-custom="2">
<h1 data-testid="3" nested={() => <div data-testid="4">nested</div>}>
Hello World!
</h1>
</div>
</div>
</div>
)
}
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
// This is a comment.

"use strict";
'use strict'

/**
* This is a comment.
*/

"use client";
'use client'

// This is a comment.

"foo";
'foo'

"use client";
'use client'

import "fs"

"bar";
import 'fs'
;('bar')

// This is a comment.

1 + 1;

"baz";
1 + 1
;('baz')

export default function () {
return null;
return null
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"use client";
'use client'

module.exports = function () {}
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
// This is a comment.

"use strict";
'use strict'

/**
* This is a comment.
*/

"use client";
'use client'

// This is a comment.

"random-directive";
'random-directive'

import "fs"

"qwerty";
import 'fs'
;('qwerty')

// This is a comment.

1 + 1;

"sasaya";
1 + 1
;('sasaya')

export default function () {
return null;
return null
}

export const a = 1
Expand Down
Loading

0 comments on commit 1fbaf44

Please sign in to comment.