Skip to content

Commit ad28bf2

Browse files
committed
- Linting: Temporarily disable most linting, with a few fixes
1 parent 93c1587 commit ad28bf2

12 files changed

+23
-20
lines changed

.eslintrc.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,33 @@ module.exports = {
3333
}],
3434
rules: {
3535
// 'push-with-multiple-arguments': 2,
36+
/*
3637
'no-unused-vars': [
3738
2,
3839
{
3940
vars: 'all',
4041
args: 'none'
4142
}
4243
],
44+
*/
45+
'no-unused-vars': 0,
46+
'no-prototype-builtins': 0,
4347
'new-cap': [
4448
2,
4549
{
4650
capIsNew: false
4751
}
4852
],
4953
semi: ['error'],
50-
indent: ['error', 4, { SwitchCase: 1 }],
54+
// indent: ['error', 4, { SwitchCase: 1 }],
5155
'prefer-const': ['error'],
52-
'no-var': ['error'],
53-
'prefer-destructuring': ['error'],
54-
'object-shorthand': ['error'],
55-
'object-curly-spacing': ['error', 'always'],
56-
quotes: ['error', 'single'],
57-
'quote-props': ['error', 'as-needed'],
58-
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
59-
'prefer-template': ['error']
56+
// 'no-var': ['error'],
57+
// 'prefer-destructuring': ['error'],
58+
// 'object-shorthand': ['error'],
59+
// 'object-curly-spacing': ['error', 'always'],
60+
// quotes: ['error', 'single'],
61+
// 'quote-props': ['error', 'as-needed'],
62+
'brace-style': ['error', '1tbs', { allowSingleLine: true }]
63+
// 'prefer-template': ['error']
6064
}
6165
};

benchmark/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ new Benchmark.Suite()
2424
})
2525

2626
.on('start', function () {
27-
console.log('Benchmarking...')
27+
console.log('Benchmarking...');
2828
})
2929

3030
.on('cycle', function (event) {

benchmark/old.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3232
*/
3333

34-
/*global exports:true, require:true, global:true*/
3534
(function () {
3635
'use strict';
3736

bin/esgenerate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ if (files.length === 0) {
5151

5252
if (args.config) {
5353
try {
54-
options = JSON.parse(fs.readFileSync(args.config, 'utf-8'))
54+
options = JSON.parse(fs.readFileSync(args.config, 'utf-8'));
5555
} catch (err) {
5656
console.error('Error parsing config: ', err);
5757
}

escodegen.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3434
*/
3535

36-
/*global exports:true, require:true, global:true*/
3736
(function () {
3837
'use strict';
3938

escodegen.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/ast.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ data = {
6060
type: 'ExpressionStatement',
6161
expression: {
6262
type: 'Literal',
63-
value: new RegExp('\n', 'i')
63+
value: /\n/i
6464
},
6565
}],
6666
expected: '/\\n/i;'
@@ -71,7 +71,7 @@ data = {
7171
type: 'ExpressionStatement',
7272
expression: {
7373
type: 'Literal',
74-
value: new RegExp('\r', 'i')
74+
value: /\r/i
7575
},
7676
}],
7777
expected: '/\\r/i;'

test/loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function freezing(escodegen) {
3737
return original.apply(this, arguments);
3838
};
3939
return escodegen;
40-
};
40+
}
4141

4242
module.exports = freezing(escodegen);
4343

test/source-map.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ describe('source map test', function () {
470470
});
471471

472472
it('sourceContent support', async function() {
473-
var source = "(+ a b)"
473+
var source = "(+ a b)";
474474
var ast = {
475475
"type": "ExpressionStatement",
476476
"expression": {"type": "BinaryExpression",

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13603,7 +13603,7 @@ data = {
1360313603
expression: {
1360413604
type: 'Literal',
1360513605
value: 'use strict',
13606-
raw: '\"use strict\"',
13606+
raw: '"use strict"',
1360713607
range: [37, 49],
1360813608
loc: {
1360913609
start: { line: 1, column: 37 },

tools/entry-point.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
(function () {
2626
'use strict';
2727
global.escodegen = require('../escodegen');
28-
escodegen.browser = true;
28+
global.escodegen.browser = true;
2929
}());

tools/rules/push-with-multiple-arguments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2323
*/
2424

25-
'use strict'
25+
'use strict';
2626

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

0 commit comments

Comments
 (0)