Skip to content

Commit 4f5852c

Browse files
authoredDec 3, 2019
feat: [BREAKING_CHANGE] use ecma 2020 supporting bigint (#49)
1 parent 664eead commit 4f5852c

File tree

7 files changed

+37
-11
lines changed

7 files changed

+37
-11
lines changed
 

‎index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
const builtin = [
44
'./lib/legacy',
55
'./lib/rules/es6',
6-
'./lib/rules/esnext',
6+
'./lib/rules/es2020',
77
].map(require.resolve);
88

99
module.exports = {
1010
extends: builtin.concat([
1111
'plugin:eggache/recommended',
1212
]),
1313
parserOptions: {
14+
ecmaVersion: 2020,
1415
sourceType: 'script',
1516
},
1617
};

‎lib/rules/es2020.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
module.exports = {
4+
env: {
5+
es2020: true,
6+
},
7+
};

‎lib/rules/esnext.js

-7
This file was deleted.

‎package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"coffee": "^5.1.0",
2727
"egg-bin": "^1.0.0",
2828
"egg-ci": "^1.8.0",
29-
"eslint": "^5.4.0",
29+
"eslint": "^6.6.0",
3030
"git-contributor": "^1.0.10",
3131
"typescript": "^3.5.3"
3232
},
@@ -44,9 +44,9 @@
4444
"contributor": "git-contributor"
4545
},
4646
"engines": {
47-
"node": ">=8.0.0"
47+
"node": ">=10.0.0"
4848
},
4949
"ci": {
50-
"version": "8, 10, 12"
50+
"version": "10, 12"
5151
}
5252
}

‎test/es2020.test.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
const path = require('path');
4+
const coffee = require('coffee');
5+
6+
describe('test/es2020.test.js', () => {
7+
8+
it('should support bigint', () => {
9+
const cwd = path.join(__dirname, 'fixtures/es2020');
10+
return coffee.spawn('eslint', [ 'bigint.js' ], { cwd })
11+
// .debug()
12+
.expect('code', 0)
13+
.end();
14+
});
15+
});

‎test/fixtures/es2020/.eslintrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../../../index.js"
3+
}

‎test/fixtures/es2020/bigint.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
'use strict';
2+
3+
const i = 1n;
4+
console.log(i);
5+
6+
const j = BigInt(1);
7+
console.log(j);

0 commit comments

Comments
 (0)
Please sign in to comment.