Skip to content

Commit 31da884

Browse files
authored
Add Support for Numeric Separators (#3544)
1 parent 8726089 commit 31da884

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/scanners/javascript.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ESLINT_RULE_MAPPING, ESLINT_TYPES } from 'const';
1010
import * as messages from 'messages';
1111
import { ensureFilenameExists } from 'utils';
1212

13-
const ECMA_VERSION = 2020;
13+
const ECMA_VERSION = 2021;
1414

1515
const IGNORE_FILE = 'addons-linter.eslintignore';
1616

tests/unit/scanners/test.javascript.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,15 @@ describe('JavaScript Scanner', () => {
150150
expect(linterMessages).toEqual([]);
151151
});
152152

153+
it('should support numeric separators', async () => {
154+
const code = 'const num = 1_0;';
155+
156+
const jsScanner = new JavaScriptScanner(code, 'code.js');
157+
158+
const { linterMessages } = await jsScanner.scan();
159+
expect(linterMessages).toEqual([]);
160+
});
161+
153162
it('should support es6 modules', async () => {
154163
const addonLinter = new Linter({
155164
_: ['tests/fixtures/webextension_es6_module'],

0 commit comments

Comments
 (0)