-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add ESLint and pin next peer dependency range #21
Merged
jescalan
merged 26 commits into
hashicorp:master
from
floroz:daniele-tortora/unit-test-main
Jun 7, 2021
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
1b3293e
chore: 🤖 install jest eslint and draft testing strategy plan
3d976f0
chore: 🤖 add eslint npm script
c036c3d
test: 💍 add unit tests and refactor file structure
f392c1d
chore: 🤖 rename import
1fef475
test: 💍 add test for start watcher
ac60ebe
test: 💍 add test for watcher
d1d3423
chore: 🤖 add nextjs as peer dependency
e3bf8c0
refactor: 💡 better code encapsulation and naming
08a30fa
refactor: 💡 better naming for files
987372e
refactor: 💡 more file name and import change for better clarity
5825452
chore: 🤖 removed eslint comment
4a4e411
chore: 🤖 remove from git testing plan
5dd97fa
chore: 🤖 fix import
673a408
chore: 🤖 eslint plugin import
40fcdba
test: 💍 test coverage and refactor for express server
f80b875
chore: 🤖 eslint group imports
9e59b22
refactor: 💡 change import style for better clarity
171253f
chore: 🤖 function renaming
065bac7
refactor: 💡 create router within scope of express start functio
370d0e5
refactor: 💡 migrate to arrow function
812b251
chore: 🤖 eslint import fix
70f296a
docs: ✏️ add comment for deprecated api
27f1252
chore: 🤖 semver support for next 10
c19829f
refactor: 💡 change test to use jest utils
dfa3087
Update src/main.js
floroz fcfeb1f
feat: restore project structure and expand linting config
floroz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.next | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"extends": ["eslint:recommended", "plugin:import/recommended", "prettier"], | ||
"plugins": ["import"], | ||
"env": { | ||
"node": true, | ||
"jest": true, | ||
"browser": true | ||
}, | ||
"parserOptions": { | ||
"ecmaFeatures": { | ||
"jsx": true | ||
} | ||
}, | ||
"settings": { | ||
"import/extensions": [".js", ".jsx"] | ||
}, | ||
"rules": { | ||
"import/order": [ | ||
"error", | ||
{ | ||
"newlines-between": "always", | ||
"alphabetize": { "order": "asc" }, | ||
"groups": [["builtin", "external"], "sibling", "parent"] | ||
} | ||
], | ||
"import/no-unresolved": [2, { "commonjs": true }] | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["bin/*"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:node/recommended", | ||
"plugin:import/recommended", | ||
"prettier" | ||
], | ||
"plugins": ["import", "node"], | ||
"env": { | ||
"node": true, | ||
"jest": true | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,16 @@ | ||
#!/usr/bin/env node | ||
|
||
const program = require('commander') | ||
const pkg = require('../package.json') | ||
const express = require('express') | ||
const bodyParser = require('body-parser') | ||
const chalk = require('chalk') | ||
const { parse } = require('url') | ||
const chokidar = require('chokidar') | ||
const program = require('commander') | ||
const express = require('express') | ||
const next = require('next') | ||
const path = require('path') | ||
// TODO: parse is deprecated in favour of new URL api | ||
// eslint-disable-next-line node/no-deprecated-api | ||
const { parse } = require('url') | ||
|
||
const pkg = require('../package.json') | ||
|
||
const defaultWatchEvent = 'change' | ||
|
||
|
@@ -76,7 +78,7 @@ app.prepare().then(() => { | |
|
||
// special handling for mdx reload route | ||
const reloadRoute = express.Router() | ||
reloadRoute.use(bodyParser.json()) | ||
reloadRoute.use(express.json()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bodyparser is now baked in express |
||
reloadRoute.all('/', (req, res) => { | ||
// log message if present | ||
const msg = req.body.message | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we create an override here to avoid applying the
node
settings and plugin to the rest of the project (which may include browser environments and next.js files)