diff --git a/.eslintrc b/.eslintrc index 5381bcfe..07121342 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,16 +1,14 @@ { "parserOptions": { - "ecmaVersion": 6, - "sourceType": "module" - }, - "ecmaFeatures": { - "modules": true + "ecmaVersion": 2018, // suppport syntax features (like Object spread operator) up to es2018 + "sourceType": "module", + "ecmaFeatures": { + "impliedStrict": true + } }, "env": { - "node": true - }, - "globals": { - + "node": true, + "es2017": true // suppport globals (like Promise) up to es2017 (es2018 doesn't have new globals) }, "rules": { "curly": 2, diff --git a/.gitignore b/.gitignore index 3c3629e6..0433bbc0 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ node_modules +.idea +package-lock.json diff --git a/.travis.yml b/.travis.yml index 66c11761..692b014f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,5 +6,5 @@ node_js: script: - npm install - npm install -g gulp-cli - - gulp + - npm run lint - npm test diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index 76d66495..00000000 --- a/gulpfile.js +++ /dev/null @@ -1,23 +0,0 @@ -var gulp = require('gulp'), - eslint = require('gulp-eslint'); - -gulp.task('lint', function () { - // ESLint ignores files with "node_modules" paths. - // So, it's best to have gulp ignore the directory as well. - // Also, Be sure to return the stream from the task; - // Otherwise, the task may end before the stream has finished. - return gulp.src(['**/*.js','!node_modules/**']) - // eslint() attaches the lint output to the "eslint" property - // of the file object so it can be used by other modules. - .pipe(eslint()) - // eslint.format() outputs the lint results to the console. - // Alternatively use eslint.formatEach() (see Docs). - .pipe(eslint.format()) - // To have the process exit with an error code (1) on - // lint error, return the stream and pipe to failAfterError last. - .pipe(eslint.failAfterError()); -}); - -gulp.task('default', ['lint'], function () { - // This will only run if the lint task is successful... -}); diff --git a/package.json b/package.json index e0faa23c..52d88cd7 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,8 @@ "author": "Bigcommerce", "license": "BSD-4-Clause", "scripts": { + "lint": "eslint .", + "lint-and-fix": "eslint . --fix", "test": "lab -l -t 90" }, "repository": { @@ -34,11 +36,8 @@ }, "devDependencies": { "code": "^1.4.0", - "eslint": "^2.7.0", + "eslint": "^6.8.0", "eslint-config-airbnb": "^6.2.0", - "eslint-plugin-react": "^4.3.0", - "gulp": "^3.9.1", - "gulp-eslint": "^2.0.0", "lab": "^13.0.1", "sinon": "^1.17.2" } diff --git a/test/helpers/pluck.js b/test/helpers/pluck.js index 4c1d9db9..bbf06563 100644 --- a/test/helpers/pluck.js +++ b/test/helpers/pluck.js @@ -14,8 +14,8 @@ describe('pluck helper', function() { var context = { users: [ - { 'user': 'barney', 'age': 36 }, - { 'user': 'fred', 'age': 40 } + { 'user': 'barney', 'age': 36 }, + { 'user': 'fred', 'age': 40 } ] };