Skip to content
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

Fix eslint in config folder #1092

Merged
merged 2 commits into from
Mar 16, 2020
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
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"extends": "vtex",
"root": true,
"env": {
"browser": true,
"node": true,
"es6": true,
"jest": true
Expand Down
6 changes: 4 additions & 2 deletions config/env.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable global-require */

'use strict'

const fs = require('fs')
Expand All @@ -10,15 +12,15 @@ const paths = {
dotenv: resolveApp('.env'),
}

const NODE_ENV = process.env.NODE_ENV
const { NODE_ENV } = process.env
if (!NODE_ENV) {
throw new Error(
'The NODE_ENV environment variable is required but was not specified.'
)
}

// https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
var dotenvFiles = [
const dotenvFiles = [
`${paths.dotenv}.${NODE_ENV}.local`,
`${paths.dotenv}.${NODE_ENV}`,
// Don't include `.env.local` for `test` environment
Expand Down
1 change: 1 addition & 0 deletions config/jest/fileTransform.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'

const path = require('path')

const camelcase = require('camelcase')

// This is a custom Jest transformer turning file imports into filenames.
Expand Down
2 changes: 2 additions & 0 deletions config/polyfills.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable global-require */

'use strict'

if (typeof Promise === 'undefined') {
Expand Down
4 changes: 3 additions & 1 deletion config/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ process.on('unhandledRejection', err => {
// Ensure environment variables are read.
require('./env')

const { execSync } = require('child_process')

const jest = require('jest')
const execSync = require('child_process').execSync

const argv = process.argv.slice(2)

function isInGitRepository() {
Expand Down
4 changes: 4 additions & 0 deletions config/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
/* eslint-disable global-require */

'use strict'

const path = require('path')

const autoprefixer = require('autoprefixer')
const webpack = require('webpack')
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin')
const WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin')

const babelConfig = require('../babel.config.js')

const appSrc = path.join(__dirname, '..', 'react')
const appNodeModules = path.join(__dirname, '..', 'react', 'node_modules')

Expand Down