Skip to content

Commit

Permalink
Add Support for Numeric Separators (#3544)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelts1 committed Jan 15, 2021
1 parent 8726089 commit 31da884
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/scanners/javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ESLINT_RULE_MAPPING, ESLINT_TYPES } from 'const';
import * as messages from 'messages';
import { ensureFilenameExists } from 'utils';

const ECMA_VERSION = 2020;
const ECMA_VERSION = 2021;

const IGNORE_FILE = 'addons-linter.eslintignore';

Expand Down
9 changes: 9 additions & 0 deletions tests/unit/scanners/test.javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ describe('JavaScript Scanner', () => {
expect(linterMessages).toEqual([]);
});

it('should support numeric separators', async () => {
const code = 'const num = 1_0;';

const jsScanner = new JavaScriptScanner(code, 'code.js');

const { linterMessages } = await jsScanner.scan();
expect(linterMessages).toEqual([]);
});

it('should support es6 modules', async () => {
const addonLinter = new Linter({
_: ['tests/fixtures/webextension_es6_module'],
Expand Down

0 comments on commit 31da884

Please sign in to comment.