Skip to content

Commit 70ee184

Browse files
feat: add eslint (#249)
1 parent 9a496f8 commit 70ee184

Some content is hidden

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

54 files changed

+14922
-2477
lines changed

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
max_line_length = 120
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true

.eslintignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.next
2+
/next.config.js
3+
node_modules
4+
src/cypress
5+
src/lib/helpers/logger.js
6+
src/lib/helpers/asyncForEach.js
7+
src/lib/templates
8+
src/tests
9+
test/sample/node_modules
10+
test/sample/out_functions
11+
test/sample/netlify/functions
12+
test/sample/my-publish-dir
13+
test/sample/.next
14+
test/sample/.netlify

.eslintrc.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
const { overrides } = require('@netlify/eslint-config-node')
2+
3+
module.exports = {
4+
extends: '@netlify/eslint-config-node',
5+
rules: {
6+
complexity: 0,
7+
'fp/no-let': 0,
8+
'fp/no-loops': 0,
9+
'fp/no-mutation': 0,
10+
'fp/no-mutating-methods': 0,
11+
'id-length': 0,
12+
'max-statements': 0,
13+
'no-await-in-loop': 0,
14+
'node/exports-style': 0,
15+
'node/global-require': 0,
16+
'node/no-unpublished-require': 0,
17+
'node/prefer-global/process': 0,
18+
'no-magic-numbers': 0,
19+
'no-promise-executor-return': 0,
20+
'no-prototype-builtins': 0,
21+
'no-shadow': 0,
22+
'no-unused-vars': 0,
23+
'prefer-regex-literals': 0,
24+
'promise/prefer-await-to-callbacks': 0,
25+
'unicorn/filename-case': 0,
26+
'unicorn/no-array-push-push': 0,
27+
},
28+
overrides: [...overrides],
29+
}

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ jobs:
2626
uses: actions/setup-node@v2
2727
with:
2828
node-version: ${{ matrix.node-version }}
29-
- run: npm install
29+
- run: npm ci
30+
- name: Linting
31+
run: npm run format:ci
32+
if: "${{ matrix.node-version == '15.x' }}"
3033
- run: npm test

.prettierignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ __mocks__
2121
test/fixtures
2222
test/sample
2323
next.config.js
24-
src/cypress/builds/
25-
src/tests/builds/
24+
src/cypress
25+
src/tests

.prettierrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
...require('@netlify/eslint-config-node/.prettierrc.json'),
3+
endOfLine: 'auto',
4+
}

.prettierrc.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
const fs = require('fs')
22
const path = require('path')
33
const util = require('util')
4-
const makeDir = require('make-dir')
4+
55
const findUp = require('find-up')
6-
const nextOnNetlify = require('./src/index.js')
6+
const makeDir = require('make-dir')
77

8-
const validateNextUsage = require('./helpers/validateNextUsage')
8+
const { restoreCache, saveCache } = require('./helpers/cacheBuild')
9+
const copyUnstableIncludedDirs = require('./helpers/copyUnstableIncludedDirs')
910
const doesNotNeedPlugin = require('./helpers/doesNotNeedPlugin')
1011
const getNextConfig = require('./helpers/getNextConfig')
11-
const copyUnstableIncludedDirs = require('./helpers/copyUnstableIncludedDirs')
12-
const { restoreCache, saveCache } = require('./helpers/cacheBuild')
12+
const validateNextUsage = require('./helpers/validateNextUsage')
13+
const nextOnNetlify = require('./src/index.js')
1314

1415
const pWriteFile = util.promisify(fs.writeFile)
1516

0 commit comments

Comments
 (0)