8000 Codestyle unification (#187) · opennextjs/opennextjs-aws@d221fbc · GitHub
[go: up one dir, main page]

Skip to content

Commit d221fbc

Browse files
authored
Codestyle unification (#187)
* feat(eslint): configuration added for eslint and general styling
1 parent 5dc78d4 commit d221fbc

Some content is hidden

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

71 files changed

+4855
-2232
lines changed

.changeset/aggregate.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { execSync } from "node:child_process";
55
const THANKLESS_COMMITTERS = ["thdxr", "fwang", "jayair"];
66

77
const { version } = JSON.parse(
8-
await fs.readFile("./packages/open-next/package.json")
8+
await fs.readFile("./packages/open-next/package.json"),
99
);
1010

1111
const changesets = JSON.parse(await fs.readFile(".changeset/config.json"));
@@ -16,7 +16,7 @@ for (const pkg of packages) {
1616
const changelog = path.join(
1717
"packages",
1818
pkg.split("/").at(-1),
19-
"CHANGELOG.md"
19+
"CHANGELOG.md",
2020
);
2121
const lines = (await fs.readFile(changelog)).toString().split("\n");
2222
let start = false;
@@ -36,7 +36,7 @@ for (const pkg of packages) {
3636
for (const user of THANKLESS_COMMITTERS) {
3737
line = line.replace(
3838
`Thanks [@${user}](https://github.com/${user})! `,
39-
""
39+
"",
4040
);
4141
}
4242
changes.add(line);

.eslintrc.cjs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
extends: ["@sladg/eslint-config-base/node"],
3+
ignorePatterns: [
4+
"**/node_modules/**",
5+
"**/dist/**",
6+
"**/pnpm-lock.yaml",
7+
"packages/open-next/assets/sharp-node-modules",
8+
],
9+
rules: {
10+
"prettier/prettier": [
11+
"error",
12+
{
13+
// This resets rules to prettier's defaults
14+
},
15+
],
16+
"sonarjs/elseif-without-else": "warn",
17+
"sonarjs/no-duplicate-string": "warn",
18+
"sonarjs/cognitive-complexity": "warn",
19+
},
20+
};

.prettierignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ function invalidateCFPaths(paths: string[]) {
316316
Items: paths,
317317
},
318318
},
319-
})
319+
}),
320320
);
321321
}
322322
```

docs/components/Layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Head from "next/head";
2+
23
import { SITE } from "../config";
34
import styles from "../styles/Layout.module.css";
45

docs/next.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @type {import('next').NextConfig} */
22

3-
let basePath = undefined
4-
let assetPrefix = undefined
3+
let basePath = undefined;
4+
let assetPrefix = undefined;
55

66
///** Deploys as a directory through GitHub Actions **/
77
//const isGithubActions = process.env.GITHUB_ACTIONS || false
@@ -25,6 +25,6 @@ const nextConfig = {
2525

2626
basePath: basePath,
2727
assetPrefix: assetPrefix,
28-
}
28+
};
2929

30-
module.exports = nextConfig
30+
module.exports = nextConfig;

docs/pages/404.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
EED3 @@ -1,5 +1,6 @@
11
import Head from "next/head";
22
import Link from "next/link";
3+
34
import { SITE } from "../config";
45
import styles from "../styles/404.module.css";
56

docs/pages/_app.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import "../styles/normalize.css";
22
import "../styles/globals.css";
3-
import Layout from "../components/Layout";
4-
import type { AppProps } from "next/app";
3+
54
import { Open_Sans } from "@next/font/google";
5+
import type { AppProps } from "next/app";
6+
7+
import Layout from "../components/Layout";
68

79
const open = Open_Sans({ subsets: ["latin"] });
810

docs/pages/index.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Link from "next/link";
2+
23
import Logo from "../components/Logo.svg";
34
import { SITE } from "../config";
45
import styles from "../styles/Home.module.css";
@@ -189,10 +190,10 @@ export default function Home() {
189190
<code>.open-next</code> directory.
190191
</p>
191192
<p>
192-
This contains a directory for your app that can be either
193-
run in a Lambda function or Lambda@Edge, a directory for an image
194-
optimization Lambda function, and another directory for your static
195-
assets that'll be uploaded to S3.
193+
This contains a directory for your app that can be either run in a
194+
Lambda function or Lambda@Edge, a directory for an image
195+
optimization Lambda function, and another directory for your
196+
static assets that'll be uploaded to S3.
196197
</p>
197198
</li>
198199
<li>
@@ -220,10 +221,7 @@ export default function Home() {
220221
<p>
221222
Note that, if you are not a library author and are just looking for a
222223
way to deploy your serverless Next.js app to AWS,{" "}
223-
<a href="https://docs.sst.dev/start/nextjs">
224-
follow this tutorial
225-
</a>
226-
.
224+
<a href="https://docs.sst.dev/start/nextjs">follow this tutorial</a>.
227225
</p>
228226
</section>
229227
</>

0 commit comments

Comments
 (0)
0