Skip to content

Commit

Permalink
Remove contains-path dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
malykhinvi committed May 18, 2021
1 parent 401428a commit 1d939fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
"dependencies": {
"array-includes": "^3.1.3",
"array.prototype.flat": "^1.2.4",
"contains-path": "^1.0.0",
"debug": "^2.6.9",
"doctrine": "^2.1.0",
"eslint-import-resolver-node": "^0.3.4",
Expand Down
6 changes: 5 additions & 1 deletion src/rules/no-restricted-paths.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import containsPath from 'contains-path';
import path from 'path';

import resolve from 'eslint-module-utils/resolve';
import moduleVisitor from 'eslint-module-utils/moduleVisitor';
import docsUrl from '../docsUrl';
import importType from '../core/importType';

const containsPath = (filepath, target) => {
const relative = path.relative(target, filepath);
return relative === '' || !relative.startsWith('..');
};

module.exports = {
meta: {
type: 'problem',
Expand Down

0 comments on commit 1d939fa

Please sign in to comment.