File tree Expand file tree Collapse file tree 7 files changed +72
-25
lines changed Expand file tree Collapse file tree 7 files changed +72
-25
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2020 node-version : 12.x
2121 - os : windows-latest
2222 node-version : 14.x
23+ - os : macos-latest
24+ node-version : 12.x
25+ - os : macos-latest
26+ node-version : 14.x
2327 steps :
2428 - name : Checkout
2529 uses : actions/checkout@v3
Original file line number Diff line number Diff line change 1919 node-version : 12.x
2020 - os : windows-latest
2121 node-version : 14.x
22+ - os : macos-latest
23+ node-version : 12.x
24+ - os : macos-latest
25+ node-version : 14.x
2226 steps :
2327 - name : Checkout
2428 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 335335 received = addNumericalSeparator ( String ( input ) )
336336 } else if ( typeof input === 'bigint' ) {
337337 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 ) {
340340 received = addNumericalSeparator ( received )
341341 }
342342
You can’t perform that action at this time.
0 commit comments