Skip to content

Commit

Permalink
- Linting: Temporarily disable most linting, with a few fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brettz9 committed May 6, 2020
1 parent 93c1587 commit ad28bf2
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 20 deletions.
22 changes: 13 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,29 +33,33 @@ module.exports = {
}],
rules: {
// 'push-with-multiple-arguments': 2,
/*
'no-unused-vars': [
2,
{
vars: 'all',
args: 'none'
}
],
*/
'no-unused-vars': 0,
'no-prototype-builtins': 0,
'new-cap': [
2,
{
capIsNew: false
}
],
semi: ['error'],
indent: ['error', 4, { SwitchCase: 1 }],
// indent: ['error', 4, { SwitchCase: 1 }],
'prefer-const': ['error'],
'no-var': ['error'],
'prefer-destructuring': ['error'],
'object-shorthand': ['error'],
'object-curly-spacing': ['error', 'always'],
quotes: ['error', 'single'],
'quote-props': ['error', 'as-needed'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
'prefer-template': ['error']
// 'no-var': ['error'],
// 'prefer-destructuring': ['error'],
// 'object-shorthand': ['error'],
// 'object-curly-spacing': ['error', 'always'],
// quotes: ['error', 'single'],
// 'quote-props': ['error', 'as-needed'],
'brace-style': ['error', '1tbs', { allowSingleLine: true }]
// 'prefer-template': ['error']
}
};
2 changes: 1 addition & 1 deletion benchmark/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ new Benchmark.Suite()
})

.on('start', function () {
console.log('Benchmarking...')
console.log('Benchmarking...');
})

.on('cycle', function (event) {
Expand Down
1 change: 0 additions & 1 deletion benchmark/old.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/*global exports:true, require:true, global:true*/
(function () {
'use strict';

Expand Down
2 changes: 1 addition & 1 deletion bin/esgenerate.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if (files.length === 0) {

if (args.config) {
try {
options = JSON.parse(fs.readFileSync(args.config, 'utf-8'))
options = JSON.parse(fs.readFileSync(args.config, 'utf-8'));
} catch (err) {
console.error('Error parsing config: ', err);
}
Expand Down
1 change: 0 additions & 1 deletion escodegen.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/*global exports:true, require:true, global:true*/
(function () {
'use strict';

Expand Down
1 change: 1 addition & 0 deletions escodegen.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions test/ast.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ data = {
type: 'ExpressionStatement',
expression: {
type: 'Literal',
value: new RegExp('\n', 'i')
value: /\n/i
},
}],
expected: '/\\n/i;'
Expand All @@ -71,7 +71,7 @@ data = {
type: 'ExpressionStatement',
expression: {
type: 'Literal',
value: new RegExp('\r', 'i')
value: /\r/i
},
}],
expected: '/\\r/i;'
Expand Down
2 changes: 1 addition & 1 deletion test/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function freezing(escodegen) {
return original.apply(this, arguments);
};
return escodegen;
};
}

module.exports = freezing(escodegen);

Expand Down
2 changes: 1 addition & 1 deletion test/source-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ describe('source map test', function () {
});

it('sourceContent support', async function() {
var source = "(+ a b)"
var source = "(+ a b)";
var ast = {
"type": "ExpressionStatement",
"expression": {"type": "BinaryExpression",
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13603,7 +13603,7 @@ data = {
expression: {
type: 'Literal',
value: 'use strict',
raw: '\"use strict\"',
raw: '"use strict"',
range: [37, 49],
loc: {
start: { line: 1, column: 37 },
Expand Down
2 changes: 1 addition & 1 deletion tools/entry-point.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
(function () {
'use strict';
global.escodegen = require('../escodegen');
escodegen.browser = true;
global.escodegen.browser = true;
}());
2 changes: 1 addition & 1 deletion tools/rules/push-with-multiple-arguments.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

'use strict'
'use strict';

module.exports = function (context) {
var MESSAGE = '"push" with multiple arguments hurts performance since optimizing compiler would not support it';
Expand Down

0 comments on commit ad28bf2

Please sign in to comment.