File tree 7 files changed +72
-25
lines changed
7 files changed +72
-25
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 20
20
node-version : 12.x
21
21
- os : windows-latest
22
22
node-version : 14.x
23
+ - os : macos-latest
24
+ node-version : 12.x
25
+ - os : macos-latest
26
+ node-version : 14.x
23
27
steps :
24
28
- name : Checkout
25
29
uses : actions/checkout@v3
Original file line number Diff line number Diff line change 19
19
node-version : 12.x
20
20
- os : windows-latest
21
21
node-version : 14.x
22
+ - os : macos-latest
23
+ node-version : 12.x
24
+ - os : macos-latest
25
+ node-version : 14.x
22
26
steps :
23
27
- name : Checkout
24
28
uses : actions/checkout@v3
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ import nbi from './no-big-int.mjs'
4
+
5
+ export default {
6
+ rules : {
7
+ 'no-big-int' : nbi ,
8
+ } ,
9
+ }
Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ export default {
4
+ meta : {
5
+ docs : {
6
+ description : 'disallow `bigint` syntax' ,
7
+ category : 'ES2020' ,
8
+ recommended : false ,
9
+ } ,
10
+ fixable : null ,
11
+ messages : {
12
+ forbidden : 'ES2020 `bigint` syntax is forbidden.' ,
13
+ } ,
14
+ schema : [ ] ,
15
+ type : 'problem' ,
16
+ } ,
17
+ create ( context ) {
18
+ return {
19
+ Literal ( node ) {
20
+ if ( node . bigint != null ) {
21
+ context . report ( { messageId : 'forbidden' , node } )
22
+ }
23
+ } ,
24
+ }
25
+ } ,
26
+ }
Original file line number Diff line number Diff line change
1
+ import { FlatCompat } from '@eslint/eslintrc'
2
+ const compat = new FlatCompat ( )
3
+
4
+ import eslintPluginLocal from './eslint-plugin-local/index.mjs'
5
+
6
+ export default [
7
+ // standard,
8
+ ...compat . extends ( 'eslint-config-standard' ) ,
9
+ {
10
+ files : [ '**/**.js' , '**/**.mjs' ] ,
11
+ languageOptions : {
12
+ sourceType : 'module' ,
13
+ ecmaVersion : 'latest' ,
14
+ } ,
15
+ plugins : { 'local' : eslintPluginLocal } ,
16
+ rules : {
17
+ /*
18
+ This is inserted to make this compatible with prettier.
19
+ Once https://github.com/prettier/prettier/issues/3845 and https://github.com/prettier/prettier/issues/3847 are solved this might be not needed any more.
20
+ */
21
+ 'space-before-function-paren' : 0 ,
22
+ curly : [ 2 , 'all' ] ,
23
+ 'local/no-big-int' : 'error' ,
24
+ } ,
25
+ } ,
26
+ ]
27
+
Original file line number Diff line number Diff line change 335
335
received = addNumericalSeparator ( String ( input ) )
336
336
} else if ( typeof input === 'bigint' ) {
337
337
received = String ( input )
338
-
339
- if ( input > 2n ** 32n || input < - ( 2n ** 32n ) ) {
338
+ const limit = BigInt ( 2 ) ** BigInt ( 32 )
339
+ if ( input > limit || input < - limit ) {
340
340
received = addNumericalSeparator ( received )
341
341
}
342
342
You can’t perform that action at this time.
0 commit comments