Skip to content

Commit

Permalink
chore!: bump all upgradable (dev)Dependencies (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin authored Mar 12, 2024
1 parent 49e3cd2 commit 3a5dab4
Show file tree
Hide file tree
Showing 17 changed files with 268 additions and 380 deletions.
5 changes: 5 additions & 0 deletions .changeset/beige-items-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-import-x": minor
---

chore!: bump all upgradable (dev)Dependencies
27 changes: 11 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@
"eslint": "^7.2.0 || ^8"
},
"dependencies": {
"debug": "^3.2.7",
"doctrine": "^2.1.0",
"debug": "^4.3.4",
"doctrine": "^3.0.0",
"eslint-import-resolver-node": "^0.3.9",
"get-tsconfig": "^4.7.3",
"is-glob": "^4.0.3",
"minimatch": "^3.1.2",
"semver": "^6.3.1"
"minimatch": "^9.0.3",
"semver": "^7.6.0"
},
"devDependencies": {
"@1stg/prettier-config": "^4.0.1",
"@angular-eslint/template-parser": "^13.5.0",
"@angular-eslint/template-parser": "^17.2.1",
"@babel/cli": "^7.23.9",
"@babel/core": "^7.24.0",
"@babel/eslint-parser": "^7.23.10",
Expand All @@ -70,10 +70,9 @@
"@test-scope/some-module": "link:./test/fixtures/symlinked-module",
"@types/jest": "^29.5.12",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^2.23.0 || ^3.3.0 || ^4.29.3 || ^5.10.0",
"chai": "^4.3.10",
"escope": "^3.6.0",
"eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8",
"@typescript-eslint/parser": "^5.62.0",
"escope": "^4.0.0",
"eslint": "^7.2.0 || ^8",
"eslint-config-prettier": "^9.1.0",
"eslint-doc-generator": "^1.7.0",
"eslint-import-resolver-typescript": "^3.6.1",
Expand All @@ -82,16 +81,12 @@
"eslint-plugin-eslint-plugin": "^2.3.0",
"eslint-plugin-import-x": "link:.",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-json": "^2.1.2",
"eslint-plugin-json": "^3.1.0",
"eslint-plugin-prettier": "^5.1.3",
"glob": "^7.2.3",
"jest": "^29.7.0",
"jsonc-parser": "^3.2.1",
"lodash.isarray": "^4.0.0",
"prettier": "^3.2.5",
"redux": "^3.7.2",
"rimraf": "^2.7.1",
"sinon": "^2.4.1",
"redux": "^5.0.1",
"rimraf": "^5.0.5",
"svelte": "^4.2.12",
"typescript": "^5.4.2"
}
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-extraneous-dependencies.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path'
import fs from 'fs'
import pkgUp from '../utils/pkgUp'
import minimatch from 'minimatch'
import { minimatch } from 'minimatch'
import resolve from '../utils/resolve'
import moduleVisitor from '../utils/moduleVisitor'
import importType from '../core/importType'
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-import-module-exports.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import minimatch from 'minimatch'
import { minimatch } from 'minimatch'
import path from 'path'
import pkgUp from '../utils/pkgUp'

Expand Down
6 changes: 3 additions & 3 deletions src/rules/no-internal-modules.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import minimatch from 'minimatch'
import { makeRe } from 'minimatch'

import resolve from '../utils/resolve'
import importType from '../core/importType'
Expand Down Expand Up @@ -48,8 +48,8 @@ module.exports = {

create: function noReachingInside(context) {
const options = context.options[0] || {}
const allowRegexps = (options.allow || []).map(p => minimatch.makeRe(p))
const forbidRegexps = (options.forbid || []).map(p => minimatch.makeRe(p))
const allowRegexps = (options.allow || []).map(p => makeRe(p))
const forbidRegexps = (options.forbid || []).map(p => makeRe(p))

// minimatch patterns are expected to use / path separators, like import
// statements, so normalize paths to use the same
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-namespace.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @author Radek Benkel
*/

import minimatch from 'minimatch'
import { minimatch } from 'minimatch'
import docsUrl from '../docsUrl'

//------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-unassigned-import.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'path'
import minimatch from 'minimatch'
import { minimatch } from 'minimatch'

import isStaticRequire from '../core/staticRequire'
import docsUrl from '../docsUrl'
Expand Down
2 changes: 1 addition & 1 deletion src/rules/order.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

import minimatch from 'minimatch'
import { minimatch } from 'minimatch'

import importType from '../core/importType'
import isStaticRequire from '../core/staticRequire'
Expand Down
2 changes: 1 addition & 1 deletion test/core/importType.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ describe('importType(name)', () => {
const foldersContext = testContext({
'import-x/external-module-folders': [],
})
expect(importType('chai', foldersContext)).toBe('internal')
expect(importType('jest', foldersContext)).toBe('internal')
})

it("should return 'internal' for module from 'node_modules' if its name matched 'internal-regex'", () => {
Expand Down
3 changes: 0 additions & 3 deletions test/fixtures/node_modules/chai/package.json

This file was deleted.

File renamed without changes.
3 changes: 3 additions & 0 deletions test/fixtures/node_modules/jest/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"rxjs": "^1.0.0"
},
"optionalDependencies": {
"lodash.isarray": "^4.0.0"
"lodash": "^4.0.0"
},
"devDependencies": {
"eslint": "2.x",
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = {
extensions: ['', '.js', '.jsx'],
root: __dirname,
alias: {
'alias/chai$': 'chai', // alias for no-extraneous-dependencies tests
'alias/jest$': 'jest', // alias for no-extraneous-dependencies tests
'alias/esm-package': 'esm-package', // alias for no-extraneous-dependencies tests
},
},
Expand Down
36 changes: 18 additions & 18 deletions test/rules/no-extraneous-dependencies.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,17 @@ ruleTester.run('no-extraneous-dependencies', rule, {
},
}),
test({
code: 'import chai from "chai"',
code: 'import jest from "jest"',
options: [{ devDependencies: ['*.spec.js'] }],
filename: 'foo.spec.js',
}),
test({
code: 'import chai from "chai"',
code: 'import jest from "jest"',
options: [{ devDependencies: ['*.spec.js'] }],
filename: path.join(process.cwd(), 'foo.spec.js'),
}),
test({
code: 'import chai from "chai"',
code: 'import jest from "jest"',
options: [{ devDependencies: ['*.test.js', '*.spec.js'] }],
filename: path.join(process.cwd(), 'foo.spec.js'),
}),
Expand Down Expand Up @@ -292,12 +292,12 @@ ruleTester.run('no-extraneous-dependencies', rule, {
],
}),
test({
code: 'import "lodash.isarray"',
code: 'import "lodash"',
options: [{ optionalDependencies: false }],
errors: [
{
message:
"'lodash.isarray' should be listed in the project's dependencies, not optionalDependencies.",
"'lodash' should be listed in the project's dependencies, not optionalDependencies.",
},
],
}),
Expand All @@ -321,56 +321,56 @@ ruleTester.run('no-extraneous-dependencies', rule, {
],
}),
test({
code: 'import chai from "chai"',
code: 'import jest from "jest"',
options: [{ devDependencies: ['*.test.js'] }],
filename: 'foo.tes.js',
errors: [
{
message:
"'chai' should be listed in the project's dependencies, not devDependencies.",
"'jest' should be listed in the project's dependencies, not devDependencies.",
},
],
}),
test({
code: 'import chai from "chai"',
code: 'import jest from "jest"',
options: [{ devDependencies: ['*.test.js'] }],
filename: path.join(process.cwd(), 'foo.tes.js'),
errors: [
{
message:
"'chai' should be listed in the project's dependencies, not devDependencies.",
"'jest' should be listed in the project's dependencies, not devDependencies.",
},
],
}),
test({
code: 'import chai from "chai"',
code: 'import jest from "jest"',
options: [{ devDependencies: ['*.test.js', '*.spec.js'] }],
filename: 'foo.tes.js',
errors: [
{
message:
"'chai' should be listed in the project's dependencies, not devDependencies.",
"'jest' should be listed in the project's dependencies, not devDependencies.",
},
],
}),
test({
code: 'import chai from "chai"',
code: 'import jest from "jest"',
options: [{ devDependencies: ['*.test.js', '*.spec.js'] }],
filename: path.join(process.cwd(), 'foo.tes.js'),
errors: [
{
message:
"'chai' should be listed in the project's dependencies, not devDependencies.",
"'jest' should be listed in the project's dependencies, not devDependencies.",
},
],
}),
test({
code: 'var eslint = require("lodash.isarray")',
code: 'var eslint = require("lodash")',
options: [{ optionalDependencies: false }],
errors: [
{
message:
"'lodash.isarray' should be listed in the project's dependencies, not optionalDependencies.",
"'lodash' should be listed in the project's dependencies, not optionalDependencies.",
},
],
}),
Expand Down Expand Up @@ -484,13 +484,13 @@ ruleTester.run('no-extraneous-dependencies', rule, {
],
}),
test({
code: 'import chai from "alias/chai";',
code: 'import jest from "alias/jest";',
settings: { 'import-x/resolver': 'webpack' },
errors: [
{
// missing dependency is chai not alias
// missing dependency is jest not alias
message:
"'chai' should be listed in the project's dependencies. Run 'npm i -S chai' to add it",
"'jest' should be listed in the project's dependencies. Run 'npm i -S jest' to add it",
},
],
}),
Expand Down
60 changes: 37 additions & 23 deletions test/rules/no-internal-modules.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,6 @@ ruleTester.run('no-internal-modules', rule, {
},
],
}),
test({
code: 'import b from "app/a"',
filename: testFilePath('./internal-modules/plugins/plugin2/internal.js'),
options: [
{
forbid: ['app/**/**'],
},
],
}),
test({
code: 'import b from "@org/package"',
filename: testFilePath('./internal-modules/plugins/plugin2/internal.js'),
Expand Down Expand Up @@ -168,15 +159,6 @@ ruleTester.run('no-internal-modules', rule, {
},
],
}),
test({
code: 'export * from "app/a"',
filename: testFilePath('./internal-modules/plugins/plugin2/internal.js'),
options: [
{
forbid: ['app/**/**'],
},
],
}),
test({
code: 'export { b } from "@org/package"',
filename: testFilePath('./internal-modules/plugins/plugin2/internal.js'),
Expand Down Expand Up @@ -215,6 +197,22 @@ ruleTester.run('no-internal-modules', rule, {
},
],
}),
test({
code: 'import b from "app/a"',
filename: testFilePath('./internal-modules/plugins/plugin2/internal.js'),
options: [
{
forbid: ['app/**/**'],
},
],
errors: [
{
message: 'Reaching to "app/a" is not allowed.',
line: 1,
column: 15,
},
],
}),
test({
code: 'import "./app/index.js"',
filename: testFilePath('./internal-modules/plugins/plugin2/internal.js'),
Expand Down Expand Up @@ -265,11 +263,11 @@ ruleTester.run('no-internal-modules', rule, {
],
}),
test({
code: 'import get from "debug/node"',
code: 'import get from "debug/src/node"',
filename: testFilePath('./internal-modules/plugins/plugin.js'),
errors: [
{
message: 'Reaching to "debug/node" is not allowed.',
message: 'Reaching to "debug/src/node" is not allowed.',
line: 1,
column: 17,
},
Expand All @@ -280,7 +278,7 @@ ruleTester.run('no-internal-modules', rule, {
filename: testFilePath('./internal-modules/plugins/plugin2/internal.js'),
options: [
{
forbid: ['*/app/*'],
forbid: ['**/app/*'],
},
],
errors: [
Expand Down Expand Up @@ -405,6 +403,22 @@ ruleTester.run('no-internal-modules', rule, {
},
],
}),
test({
code: 'export * from "app/a"',
filename: testFilePath('./internal-modules/plugins/plugin2/internal.js'),
options: [
{
forbid: ['app/**/**'],
},
],
errors: [
{
message: 'Reaching to "app/a" is not allowed.',
line: 1,
column: 15,
},
],
}),
test({
code: 'export * from "./app/index.js"',
filename: testFilePath('./internal-modules/plugins/plugin2/internal.js'),
Expand Down Expand Up @@ -455,11 +469,11 @@ ruleTester.run('no-internal-modules', rule, {
],
}),
test({
code: 'export {get} from "debug/node"',
code: 'export {get} from "debug/src/node"',
filename: testFilePath('./internal-modules/plugins/plugin.js'),
errors: [
{
message: 'Reaching to "debug/node" is not allowed.',
message: 'Reaching to "debug/src/node" is not allowed.',
line: 1,
column: 19,
},
Expand Down
Loading

0 comments on commit 3a5dab4

Please sign in to comment.