Skip to content

Commit

Permalink
Upgrade dependencies and ditch airbnb eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanmaric committed Aug 24, 2020
1 parent 1f65563 commit e1a5222
Show file tree
Hide file tree
Showing 22 changed files with 41 additions and 56 deletions.
34 changes: 10 additions & 24 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
{
"extends": ["airbnb-base"],
"env": {
"node": true
},
"extends": [
"@stefanmaric/eslint-config-munchies-base",
"@stefanmaric/eslint-config-munchies-modern",
"@stefanmaric/eslint-config-munchies-gourmet"
],
"overrides": [
{
"env": {
Expand All @@ -8,27 +15,6 @@
"files": ["browser/**/*.js"]
}
],
"root": true,
"rules": {
"arrow-parens": ["error", "always"],
"comma-dangle": [
"error",
{
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}
],
"no-use-before-define": [
"error",
{
"classes": true,
"functions": false,
"variables": true
}
],
"semi": ["error", "never"]
}
"parser": "babel-eslint",
"root": true
}
1 change: 0 additions & 1 deletion browser/getters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/**
* Get the outer HTML of the given node.
* See: https://developer.mozilla.org/en-US/docs/Web/API/Element/outerHTML
Expand Down
1 change: 0 additions & 1 deletion lib/errors.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

class ModelError extends Error {
constructor(...args) {
super(...args)
Expand Down
1 change: 0 additions & 1 deletion lib/options.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const CSS_SELECT_OPTIONS = Object.freeze({
strict: false,
xmlMode: false,
Expand Down
26 changes: 15 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,29 @@
"dependencies": {
"css-select": "^2.0.2",
"css-select-browser-adapter": "^0.1.2",
"dom-serializer": "^0.1.1",
"htmlparser2": "^3.10.1",
"dom-serializer": "^1.0.1",
"htmlparser2": "^4.1.0",
"nearley": "^2.16.0"
},
"devDependencies": {
"@babel/core": "^7.4.0",
"@babel/preset-env": "^7.4.2",
"@stefanmaric/eslint-config-munchies-base": "^0.3.0",
"@stefanmaric/eslint-config-munchies-gourmet": "^0.3.0",
"@stefanmaric/eslint-config-munchies-modern": "^0.3.0",
"babel-eslint": "^10.1.0",
"echint": "^4.0.2",
"eslint": "^5.16.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint": "^7.7.0",
"eslint-import-resolver-node": "^0.3.4",
"eslint-plugin-import": "^2.16.0",
"prettier-eslint-cli": "^4.7.1",
"rollup": "^1.7.4",
"prettier": "^2.0.5",
"rollup": "^2.26.5",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.2.2",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^4.0.1",
"tap": "^12.6.1",
"terser": "^3.17.0"
"rollup-plugin-node-resolve": "^5.2.0",
"tap": "^14.10.8",
"terser": "^5.2.1"
},
"echint": {
"ignore": [
Expand All @@ -71,7 +75,7 @@
"build": "rollup -c -f umd browser/index.js | tee dist/browser.umd.js | terser > dist/browser.umd.min.js",
"pregrammar": "mkdir -p dist/",
"grammar": "npx nearleyc lib/query-parser.ne -o dist/grammar.js",
"format": "prettier-eslint --write './**/*.{js,json,md}'",
"format": "prettier --write './**/*.{js,json,md}' && eslint --quiet --fix './**/*.js'",
"pretest": "npm run grammar",
"test": "echint && eslint . && tap 'test/**/*.test.js'",
"prepublish": "npm run build"
Expand Down
2 changes: 1 addition & 1 deletion server/getters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const getOuterHTML = require('dom-serializer')
const { default: getOuterHTML} = require('dom-serializer')

/**
* Get the outer HTML of the given node.
Expand Down
2 changes: 1 addition & 1 deletion test/extract/01-string-as-model.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/02-string-in-array-model.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/03-single-level-object-model.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/04-multi-level-object-model.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/06-text-content.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/07-text-content-empty-node.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/08-array-of-objects.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/09-array-of-arrays.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/10-array-of-arrays-and-objects.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/11-getters.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/12-filters.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/13-unknown-filter.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')
const { UnknownFilterError } = require('../../lib/errors')

const { getFixtureSet } = require('../test-utils')
Expand Down
2 changes: 1 addition & 1 deletion test/extract/14-no-match.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')

const { getFixtureSet } = require('../test-utils')

Expand Down
2 changes: 1 addition & 1 deletion test/extract/15-bad-model.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { test } = require('tap')

const scrapy = require('../../server/')
const scrapy = require('../../server')
const { ModelError } = require('../../lib/errors')

const source = '<html></html>'
Expand Down
2 changes: 0 additions & 2 deletions test/test-utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable global-require, import/no-dynamic-require */

const fs = require('fs')
const path = require('path')

Expand Down

0 comments on commit e1a5222

Please sign in to comment.