Skip to content

Commit 4eeb86b

Browse files
committedJan 12, 2023
update eslint-plugin-import
1 parent f3464a7 commit 4eeb86b

File tree

9 files changed

+144
-70
lines changed

9 files changed

+144
-70
lines changed
 

‎package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/core-js/postinstall.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
var fs = require('fs');
22
var os = require('os');
33
var path = require('path');
4-
var env = process.env;
54

5+
var env = process.env;
66
var ADBLOCK = is(env.ADBLOCK);
77
var COLOR = is(env.npm_config_color);
88
var DISABLE_OPENCOLLECTIVE = is(env.DISABLE_OPENCOLLECTIVE);

‎scripts/bundle-tests/package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/entries/unit.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable import/no-dynamic-require, node/global-require -- required */
22
import { ok } from 'assert';
3-
const entries = await fs.readJson('packages/core-js-compat/entries.json');
43

4+
const entries = await fs.readJson('packages/core-js-compat/entries.json');
55
const expected = new Set(Object.keys(entries));
66
const tested = new Set();
77
let PATH;

‎tests/eslint/eslint.config.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const pluginQUnit = require('eslint-plugin-qunit');
1313
const pluginRegExp = require('eslint-plugin-regexp');
1414
const pluginSonarJS = require('eslint-plugin-sonarjs');
1515
const pluginUnicorn = require('eslint-plugin-unicorn');
16-
1716
const PACKAGES_NODE_VERSIONS = require('core-js-builder/package').engines.node;
17+
1818
const DEV_NODE_VERSIONS = '^16.13';
1919

2020
const ERROR = 'error';
@@ -322,6 +322,8 @@ const base = {
322322
// import:
323323
// ensure all imports appear before other statements
324324
'import/first': ERROR,
325+
// enforce a newline after import statements
326+
'import/newline-after-import': ERROR,
325327
// forbid import of modules using absolute paths
326328
'import/no-absolute-path': ERROR,
327329
// forbid AMD imports
@@ -332,6 +334,8 @@ const base = {
332334
'import/no-duplicates': ERROR,
333335
// forbid `require()` calls with expressions
334336
'import/no-dynamic-require': ERROR,
337+
// forbid empty named import blocks
338+
'import/no-empty-named-blocks': ERROR,
335339
// forbid imports with CommonJS exports
336340
'import/no-import-module-exports': ERROR,
337341
// prevent importing packages through relative paths
@@ -1180,6 +1184,7 @@ module.exports = [
11801184
'packages/core-js-pure/override/**',
11811185
'tests/**/bundles/**',
11821186
'tests/compat/compat-data.js',
1187+
'tests/unit-@(global|pure)/index.js',
11831188
],
11841189
},
11851190
{

‎tests/eslint/package-lock.json

+104-35
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/eslint/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"eslint-plugin-array-func": "^3.1.8",
77
"eslint-plugin-es-x": "^5.4.0",
88
"eslint-plugin-eslint-comments": "^3.2.0",
9-
"eslint-plugin-import": "^2.26.0",
9+
"eslint-plugin-import": "^2.27.4",
1010
"eslint-plugin-jsonc": "^2.6.0",
1111
"eslint-plugin-n": "^15.6.1",
1212
"eslint-plugin-promise": "^6.1.1",

‎tests/observables/package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/unit-global/es.number.constructor.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { WHITESPACES } from '../helpers/constants';
12
import { nativeSubclass } from '../helpers/helpers';
2-
const whitespaces = ' \t\u000B\f\u00A0\uFEFF\n\r\u2028\u2029\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000';
33

44
function getCheck(assert) {
55
return function (a, b) {
@@ -167,15 +167,15 @@ QUnit.test('Number constructor: regression', assert => {
167167

168168
number = new Number(42);
169169
assert.same(typeof number.constructor(number), 'number');
170-
check(`${ whitespaces }42`, 42);
171-
check(`42${ whitespaces }`, 42);
172-
check(`${ whitespaces }42${ whitespaces }`, 42);
173-
check(`${ whitespaces }0x42`, 66);
174-
check(`0x42${ whitespaces }`, 66);
175-
check(`${ whitespaces }0x42${ whitespaces }`, 66);
176-
check(`${ whitespaces }0X42`, 66);
177-
check(`0X42${ whitespaces }`, 66);
178-
check(`${ whitespaces }0X42${ whitespaces }`, 66);
170+
check(`${ WHITESPACES }42`, 42);
171+
check(`42${ WHITESPACES }`, 42);
172+
check(`${ WHITESPACES }42${ WHITESPACES }`, 42);
173+
check(`${ WHITESPACES }0x42`, 66);
174+
check(`0x42${ WHITESPACES }`, 66);
175+
check(`${ WHITESPACES }0x42${ WHITESPACES }`, 66);
176+
check(`${ WHITESPACES }0X42`, 66);
177+
check(`0X42${ WHITESPACES }`, 66);
178+
check(`${ WHITESPACES }0X42${ WHITESPACES }`, 66);
179179
if (nativeSubclass) {
180180
const Subclass = nativeSubclass(Number);
181181
assert.true(new Subclass() instanceof Subclass, 'correct subclassing with native classes #1');
@@ -219,12 +219,12 @@ QUnit.test('Number constructor: binary', assert => {
219219
return '0b101010';
220220
},
221221
}, 42);
222-
check(`${ whitespaces }0b11`, 3);
223-
check(`0b11${ whitespaces }`, 3);
224-
check(`${ whitespaces }0b11${ whitespaces }`, 3);
225-
check(`${ whitespaces }0B11`, 3);
226-
check(`0B11${ whitespaces }`, 3);
227-
check(`${ whitespaces }0B11${ whitespaces }`, 3);
222+
check(`${ WHITESPACES }0b11`, 3);
223+
check(`0b11${ WHITESPACES }`, 3);
224+
check(`${ WHITESPACES }0b11${ WHITESPACES }`, 3);
225+
check(`${ WHITESPACES }0B11`, 3);
226+
check(`0B11${ WHITESPACES }`, 3);
227+
check(`${ WHITESPACES }0B11${ WHITESPACES }`, 3);
228228
});
229229

230230
QUnit.test('Number constructor: octal', assert => {
@@ -262,10 +262,10 @@ QUnit.test('Number constructor: octal', assert => {
262262
return '0o12345';
263263
},
264264
}, 5349);
265-
check(`${ whitespaces }0o11`, 9);
266-
check(`0o11${ whitespaces }`, 9);
267-
check(`${ whitespaces }0o11${ whitespaces }`, 9);
268-
check(`${ whitespaces }0O11`, 9);
269-
check(`0O11${ whitespaces }`, 9);
270-
check(`${ whitespaces }0O11${ whitespaces }`, 9);
265+
check(`${ WHITESPACES }0o11`, 9);
266+
check(`0o11${ WHITESPACES }`, 9);
267+
check(`${ WHITESPACES }0o11${ WHITESPACES }`, 9);
268+
check(`${ WHITESPACES }0O11`, 9);
269+
check(`0O11${ WHITESPACES }`, 9);
270+
check(`${ WHITESPACES }0O11${ WHITESPACES }`, 9);
271271
});

0 commit comments

Comments
 (0)
Please sign in to comment.