Skip to content

Commit

Permalink
chore(lint): add no-underscore-dangle ESLint rule
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Oct 21, 2020
1 parent 581a35d commit 64e2855
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ module.exports = {
'no-negated-condition': 2,
'no-nested-ternary': 2,
'no-plusplus': [2, { allowForLoopAfterthoughts: true }],
'no-underscore-dangle': [2, { enforceInMethodNames: true }],
'no-unreachable-loop': 2,
'no-useless-backreference': 2,
'no-useless-computed-key': [2, { enforceForClassMembers: true }],
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
# We set a flag so we can skip tests that access Netlify API
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
IS_FORK: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true }}
_NETLIFY_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NETLIFY_TEST_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 4 additions & 4 deletions src/commands/functions/invoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class FunctionsInvokeCommand extends Command {
}
} else {
// NOT an event triggered function, but may still want to simulate authentication locally
let _isAuthed = false
let isAuthenticated = false
if (typeof flags.identity === 'undefined') {
const { isAuthed } = await inquirer.prompt([
{
Expand All @@ -98,11 +98,11 @@ class FunctionsInvokeCommand extends Command {
default: true,
},
])
_isAuthed = isAuthed
isAuthenticated = isAuthed
} else {
_isAuthed = flags.identity
isAuthenticated = flags.identity
}
if (_isAuthed) {
if (isAuthenticated) {
headers = {
authorization:
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb3VyY2UiOiJuZXRsaWZ5IGZ1bmN0aW9uczp0cmlnZ2VyIiwidGVzdERhdGEiOiJORVRMSUZZX0RFVl9MT0NBTExZX0VNVUxBVEVEX0pXVCJ9.Xb6vOFrfLUZmyUkXBbCvU4bM7q8tPilF0F03Wupap_c',
Expand Down
4 changes: 2 additions & 2 deletions src/lib/exec-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const getExecName = ({ execName }) => {
const getOptions = () => {
// this is used in out CI tests to avoid hitting GitHub API limit
// when calling gh-release-fetch
if (process.env._NETLIFY_GITHUB_TOKEN) {
if (process.env.NETLIFY_TEST_GITHUB_TOKEN) {
return {
headers: { Authorization: `token ${process.env._NETLIFY_GITHUB_TOKEN}` },
headers: { Authorization: `token ${process.env.NETLIFY_TEST_GITHUB_TOKEN}` },
}
}
}
Expand Down

0 comments on commit 64e2855

Please sign in to comment.