Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit 9932aa6

Browse files
committed
💎 style(eslint): eslint and prettier added to keep the styles in tact
1 parent e74a212 commit 9932aa6

File tree

8 files changed

+3723
-28
lines changed

8 files changed

+3723
-28
lines changed

Diff for: .eslintrc.js

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
module.exports = {
2+
extends: ['eslint:recommended', 'prettier'],
3+
plugins: ['prettier', '@typescript-eslint', 'unused-imports', 'simple-import-sort', 'import'],
4+
parser: '@typescript-eslint/parser',
5+
env: {
6+
node: true,
7+
commonjs: true,
8+
},
9+
rules: {
10+
'prettier/prettier': 'error',
11+
'no-new': 0,
12+
camelcase: 0,
13+
'no-nested-ternary': 0,
14+
'no-underscore-dangle': 0,
15+
'no-shadow': 0,
16+
'no-useless-return': 0,
17+
'@typescript-eslint/no-explicit-any': 0,
18+
'@typescript-eslint/no-non-null-assertion': 0,
19+
'@typescript-eslint/no-shadow': ['error'],
20+
'@typescript-eslint/no-unused-vars': [
21+
'error',
22+
{
23+
argsIgnorePattern: '^_',
24+
varsIgnorePattern: '^_',
25+
caughtErrorsIgnorePattern: '^_',
26+
},
27+
],
28+
'unused-imports/no-unused-imports': 'error',
29+
'no-multi-spaces': 'error',
30+
'no-trailing-spaces': 'error',
31+
'no-multiple-empty-lines': 'error',
32+
'space-in-parens': 'error',
33+
'no-mixed-spaces-and-tabs': 'warn',
34+
eqeqeq: ['warn', 'always'],
35+
'no-unused-vars': 'off',
36+
'simple-import-sort/imports': [
37+
'error',
38+
{
39+
groups: [
40+
['^react$'],
41+
// Side effect imports.
42+
['^\\u0000'],
43+
// Node.js builtins prefixed with `node:`.
44+
['^node:'],
45+
// Packages.
46+
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
47+
['^@?\\w'],
48+
// Absolute imports and other imports such as Vue-style `@/foo`.
49+
// Anything not matched in another group.
50+
['^@fllite-fe/*'],
51+
['^'],
52+
// Relative imports.
53+
// Anything that starts with a dot.
54+
['^\\.'],
55+
],
56+
},
57+
],
58+
'simple-import-sort/exports': 'error',
59+
'import/first': 'error',
60+
'import/newline-after-import': 'error',
61+
'import/no-duplicates': 'error',
62+
'max-len': 'off',
63+
'no-duplicate-imports': 'error',
64+
'object-curly-spacing': ['error', 'always'],
65+
'array-bracket-spacing': ['error', 'never'],
66+
'computed-property-spacing': ['error', 'never'],
67+
},
68+
}

Diff for: lib/cdk/app.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { handler, name, optimizerCodePath, optimizerLayerPath, version } from '@sladg/imaginex-lambda'
22
import { App } from 'aws-cdk-lib'
33
import path from 'path'
4+
45
import { envConfig } from './config'
56
import { NextStandaloneStack } from './stack'
67

Diff for: lib/cdk/config.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Runtime } from 'aws-cdk-lib/aws-lambda'
22
import { bool, cleanEnv, num, str } from 'envalid'
3+
34
import { DEFAULT_MEMORY as IMAGE_LAMBDA_DEFAULT_MEMORY, DEFAULT_TIMEOUT as IMAGE_LAMBDA_DEFAULT_TIMEOUT } from './utils/imageLambda'
45
import { DEFAULT_MEMORY as SERVER_LAMBDA_DEFAULT_MEMORY, DEFAULT_TIMEOUT as SERVER_LAMBDA_DEFAULT_TIMEOUT } from './utils/serverLambda'
56

Diff for: lib/cdk/stack.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { IDistribution } from 'aws-cdk-lib/aws-cloudfront'
55
import { HttpOrigin } from 'aws-cdk-lib/aws-cloudfront-origins'
66
import { Function } from 'aws-cdk-lib/aws-lambda'
77
import { Bucket } from 'aws-cdk-lib/aws-s3'
8+
89
import { CustomStackProps, MappedDomain } from './types'
910
import { setupApiGateway, SetupApiGwProps } from './utils/apiGw'
1011
import { setupCfnCertificate, SetupCfnCertificateProps } from './utils/cfnCertificate'
@@ -97,7 +98,7 @@ export class NextStandaloneStack extends Stack {
9798
domains: this.domains,
9899
})
99100

100-
if (!!config.redirectFromApex) {
101+
if (config.redirectFromApex) {
101102
this.setupApexRedirect({
102103
domain: this.domains[0],
103104
})

Diff for: lib/cli/pack.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { mkdirSync, rmSync, writeFileSync } from 'fs'
22
import { tmpdir } from 'os'
33
import path from 'path'
4+
45
import { nextServerConfigRegex } from '../consts'
5-
import { findInFile, findPathToNestedFile, validateFolderExists, validatePublicFolderStructure, zipFolder, zipMultipleFoldersOrFiles } from '../utils'
6+
import { findInFile, findPathToNestedFile, validateFolderExists, validatePublicFolderStructure, zipMultipleFoldersOrFiles } from '../utils'
67

78
interface Props {
89
standaloneFolder: string

Diff for: lib/server-handler/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable */
12
// ! This is needed for nextjs to correctly resolve.
23
process.chdir(__dirname)
34
process.env.NODE_ENV = 'production'

0 commit comments

Comments
 (0)