Skip to content

chore(deps): update dependency @netlify/eslint-config-node to v4 #903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { overrides } = require('@netlify/eslint-config-node/react_config')
const { overrides } = require('@netlify/eslint-config-node')

module.exports = {
extends: '@netlify/eslint-config-node/react_config',
extends: '@netlify/eslint-config-node',
rules: {
'max-depth': 0,
complexity: 0,
Expand All @@ -19,11 +19,9 @@ module.exports = {
'no-param-reassign': 0,
'no-promise-executor-return': 0,
'no-prototype-builtins': 0,
'no-shadow': 0,
'no-unused-vars': 0,
'prefer-regex-literals': 0,
'promise/prefer-await-to-callbacks': 0,
'require-await': 0,
'unicorn/consistent-function-scoping': 0,
'unicorn/filename-case': 0,
'unicorn/no-array-push-push': 0,
Expand Down
37 changes: 30 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"@babel/preset-env": "^7.15.8",
"@babel/preset-typescript": "^7.16.0",
"@netlify/build": "^20.1.0",
"@netlify/eslint-config-node": "^3.3.11",
"@netlify/eslint-config-node": "^4.0.0",
"@testing-library/cypress": "^8.0.1",
"@types/fs-extra": "^9.0.13",
"@types/jest": "^27.0.2",
Expand Down
8 changes: 4 additions & 4 deletions src/helpers/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ exports.moveStaticPages = async ({ netlifyConfig, target, i18n }) => {
const moveFile = async (file) => {
const isData = file.endsWith('.json')
const source = join(root, file)
const target = isData ? join(dataDir, file) : file
const targetFile = isData ? join(dataDir, file) : file

files.push(file)
filesManifest[file] = target
filesManifest[file] = targetFile

const dest = join(netlifyConfig.build.publish, target)
const dest = join(netlifyConfig.build.publish, targetFile)

try {
await move(source, dest)
Expand All @@ -130,7 +130,7 @@ exports.moveStaticPages = async ({ netlifyConfig, target, i18n }) => {

// Limit concurrent file moves to number of cpus or 2 if there is only 1
const limit = pLimit(Math.max(2, cpus().length))
const promises = pages.map(async (rawPath) => {
const promises = pages.map((rawPath) => {
const filePath = slash(rawPath)
// Don't move ISR files, as they're used for the first request
if (isrFiles.has(filePath)) {
Expand Down
6 changes: 3 additions & 3 deletions src/helpers/verification.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ exports.checkZipSize = async (file, maxSize = LAMBDA_MAX_SIZE) => {
console.warn(`Could not check zip size because ${file} does not exist`)
return
}
const size = await promises.stat(file).then(({ size }) => size)
if (size < maxSize) {
const fileSize = await promises.stat(file).then(({ size }) => size)
if (fileSize < maxSize) {
return
}
// We don't fail the build, because the actual hard max size is larger so it might still succeed
console.log(
redBright(outdent`
The function zip ${yellowBright(relative(process.cwd(), file))} size is ${prettyBytes(
size,
fileSize,
)}, which is larger than the maximum supported size of ${prettyBytes(maxSize)}.
There are a few reasons this could happen. You may have accidentally bundled a large dependency, or you might have a
large number of pre-rendered pages included.
Expand Down