Skip to content

Commit

Permalink
refactor: Enable strict mode for all files
Browse files Browse the repository at this point in the history
Only a single change (in `lib/static.js`) was necessery as a consequence.
  • Loading branch information
fb55 committed Jan 4, 2021
1 parent 4859684 commit 3fe3d6a
Show file tree
Hide file tree
Showing 27 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions .eslintrc.json
Expand Up @@ -28,6 +28,7 @@
"no-use-before-define": [2, "nofunc"],
"no-void": 2,
"yoda": 2,
"strict": 2,

"jsdoc/require-jsdoc": 0,
"jsdoc/check-param-names": 2,
Expand Down
1 change: 1 addition & 0 deletions benchmark/benchmark.js
@@ -1,4 +1,5 @@
#!/usr/bin/env node
'use strict';

var Suites = require('./suite');
var suites = new Suites();
Expand Down
1 change: 1 addition & 0 deletions benchmark/suite.js
@@ -1,3 +1,4 @@
'use strict';
var fs = require('fs');
var path = require('path');

Expand Down
1 change: 1 addition & 0 deletions index.js
@@ -1,3 +1,4 @@
'use strict';
/**
* @module cheerio
* @borrows static.load as load
Expand Down
1 change: 1 addition & 0 deletions lib/api/attributes.js
@@ -1,3 +1,4 @@
'use strict';
/**
* Methods for getting and modifying attributes.
*
Expand Down
1 change: 1 addition & 0 deletions lib/api/css.js
@@ -1,3 +1,4 @@
'use strict';
/** @module cheerio/css */

var domEach = require('../utils').domEach;
Expand Down
1 change: 1 addition & 0 deletions lib/api/forms.js
@@ -1,3 +1,4 @@
'use strict';
/** @module cheerio/forms */

// https://github.com/jquery/jquery/blob/2.1.3/src/manipulation/var/rcheckableType.js
Expand Down
1 change: 1 addition & 0 deletions lib/api/manipulation.js
@@ -1,3 +1,4 @@
'use strict';
/**
* Methods for modifying the DOM structure.
*
Expand Down
1 change: 1 addition & 0 deletions lib/api/traversing.js
@@ -1,3 +1,4 @@
'use strict';
/**
* Methods for traversing the DOM structure.
*
Expand Down
1 change: 1 addition & 0 deletions lib/cheerio.js
@@ -1,3 +1,4 @@
'use strict';
/*
Module dependencies
*/
Expand Down
1 change: 1 addition & 0 deletions lib/options.js
@@ -1,3 +1,4 @@
'use strict';
/** Cheerio default options. */
exports.default = {
xml: false,
Expand Down
1 change: 1 addition & 0 deletions lib/parse.js
@@ -1,3 +1,4 @@
'use strict';
/*
Module Dependencies
*/
Expand Down
1 change: 1 addition & 0 deletions lib/parsers/htmlparser2.js
@@ -1,2 +1,3 @@
'use strict';
exports.parse = require('htmlparser2').parseDocument;
exports.render = require('dom-serializer').default;
1 change: 1 addition & 0 deletions lib/parsers/parse5.js
@@ -1,3 +1,4 @@
'use strict';
var parse5 = require('parse5');
var htmlparser2Adapter = require('parse5-htmlparser2-tree-adapter');

Expand Down
3 changes: 2 additions & 1 deletion lib/static.js
@@ -1,3 +1,4 @@
'use strict';
/**
* @module cheerio/static
* @ignore
Expand Down Expand Up @@ -117,7 +118,7 @@ exports.html = function (dom, options) {
options = Object.assign(
{},
defaultOptions,
this._options,
this ? this._options : {},
flattenOptions(options || {})
);

Expand Down
1 change: 1 addition & 0 deletions lib/utils.js
@@ -1,3 +1,4 @@
'use strict';
var htmlparser2 = require('htmlparser2');
var domhandler = require('domhandler');

Expand Down
1 change: 1 addition & 0 deletions test/__fixtures__/fixtures.js
@@ -1,3 +1,4 @@
'use strict';
exports.fruits = [
'<ul id="fruits">',
'<li class="apple">Apple</li>',
Expand Down
1 change: 1 addition & 0 deletions test/api/attributes.js
@@ -1,3 +1,4 @@
'use strict';
var cheerio = require('../..');
var fruits = require('../__fixtures__/fixtures').fruits;
var vegetables = require('../__fixtures__/fixtures').vegetables;
Expand Down
1 change: 1 addition & 0 deletions test/api/css.js
@@ -1,3 +1,4 @@
'use strict';
var cheerio = require('../..');

describe('$(...)', function () {
Expand Down
1 change: 1 addition & 0 deletions test/api/deprecated.js
@@ -1,3 +1,4 @@
'use strict';
/**
* This file includes tests for deprecated APIs. The methods are expected to be
* removed in the next major release of Cheerio, but their stability should be
Expand Down
1 change: 1 addition & 0 deletions test/api/forms.js
@@ -1,3 +1,4 @@
'use strict';
var cheerio = require('../..');
var forms = require('../__fixtures__/fixtures').forms;

Expand Down
1 change: 1 addition & 0 deletions test/api/manipulation.js
@@ -1,3 +1,4 @@
'use strict';
var cheerio = require('../..');
var fruits = require('../__fixtures__/fixtures').fruits;
var divcontainers = require('../__fixtures__/fixtures').divcontainers;
Expand Down
1 change: 1 addition & 0 deletions test/api/traversing.js
@@ -1,3 +1,4 @@
'use strict';
var cheerio = require('../..');
var food = require('../__fixtures__/fixtures').food;
var fruits = require('../__fixtures__/fixtures').fruits;
Expand Down
1 change: 1 addition & 0 deletions test/api/utils.js
@@ -1,3 +1,4 @@
'use strict';
var fixtures = require('../__fixtures__/fixtures');
var cheerio = require('../..');

Expand Down
1 change: 1 addition & 0 deletions test/cheerio.js
@@ -1,3 +1,4 @@
'use strict';
var htmlparser2 = require('htmlparser2');
var cheerio = require('..');
var fixtures = require('./__fixtures__/fixtures');
Expand Down
1 change: 1 addition & 0 deletions test/parse.js
@@ -1,3 +1,4 @@
'use strict';
var parse = require('../lib/parse');
var defaultOpts = require('../lib/options').default;

Expand Down
1 change: 1 addition & 0 deletions test/xml.js
@@ -1,3 +1,4 @@
'use strict';
var cheerio = require('..');

function xml(str, options) {
Expand Down

0 comments on commit 3fe3d6a

Please sign in to comment.