Skip to content

Commit

Permalink
unlock eslint-config-next dependencies (vercel#35781)
Browse files Browse the repository at this point in the history
Fixes vercel#35753

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: JJ Kasper <[email protected]>
  • Loading branch information
balazsorban44 and ijjk authored Apr 28, 2022
1 parent 60f7423 commit f000503
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 94 deletions.
16 changes: 8 additions & 8 deletions packages/eslint-config-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
},
"dependencies": {
"@next/eslint-plugin-next": "12.1.6-canary.13",
"@rushstack/eslint-patch": "1.0.8",
"@typescript-eslint/parser": "5.19.0",
"eslint-import-resolver-node": "0.3.4",
"eslint-import-resolver-typescript": "2.4.0",
"eslint-plugin-import": "2.25.2",
"eslint-plugin-jsx-a11y": "6.5.1",
"eslint-plugin-react": "7.29.1",
"eslint-plugin-react-hooks": "4.3.0"
"@rushstack/eslint-patch": "^1.1.3",
"@typescript-eslint/parser": "^5.21.0",
"eslint-import-resolver-node": "^0.3.6",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.5.0"
},
"peerDependencies": {
"eslint": "^7.23.0 || ^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/compiled/find-cache-dir/index.js

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

32 changes: 24 additions & 8 deletions packages/next/compiled/webpack/bundle5.js
Original file line number Diff line number Diff line change
Expand Up @@ -135212,9 +135212,14 @@ module.exports = class AliasFieldPlugin {
);
return callback();
}
const data1 = fieldData[innerRequest];
const data2 = fieldData[innerRequest.replace(/^\.\//, "")];
const data = typeof data1 !== "undefined" ? data1 : data2;
const data = Object.prototype.hasOwnProperty.call(
fieldData,
innerRequest
)
? fieldData[innerRequest]
: innerRequest.startsWith("./")
? fieldData[innerRequest.slice(2)]
: undefined;
if (data === innerRequest) return callback();
if (data === undefined) return callback();
if (data === false) {
Expand Down Expand Up @@ -135273,6 +135278,7 @@ module.exports = class AliasFieldPlugin {


const forEachBail = __webpack_require__(78565);
const { PathType, getType } = __webpack_require__(67079);

/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
Expand All @@ -135297,6 +135303,18 @@ module.exports = class AliasPlugin {
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
const getAbsolutePathWithSlashEnding = maybeAbsolutePath => {
const type = getType(maybeAbsolutePath);
if (type === PathType.AbsolutePosix || type === PathType.AbsoluteWin) {
return resolver.join(maybeAbsolutePath, "_").slice(0, -1);
}
return null;
};
const isSubPath = (path, maybeSubPath) => {
const absolutePath = getAbsolutePathWithSlashEnding(maybeSubPath);
if (!absolutePath) return false;
return path.startsWith(absolutePath);
};
resolver
.getHook(this.source)
.tapAsync("AliasPlugin", (request, resolveContext, callback) => {
Expand All @@ -135309,11 +135327,9 @@ module.exports = class AliasPlugin {
if (
innerRequest === item.name ||
(!item.onlyModule &&
innerRequest.startsWith(
request.request
? `${item.name}/`
: resolver.join(item.name, "_").slice(0, -1)
))
(request.request
? innerRequest.startsWith(`${item.name}/`)
: isSubPath(innerRequest, item.name)))
) {
const remainingRequest = innerRequest.substr(item.name.length);
const resolveWithAlias = (alias, callback) => {
Expand Down
Loading

0 comments on commit f000503

Please sign in to comment.