Skip to content

Commit

Permalink
chore: remove resolve-from dependency (#945)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB authored Oct 12, 2021
1 parent 953664c commit 95a45c9
Show file tree
Hide file tree
Showing 38 changed files with 78 additions and 74 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
"projects": [
{
"displayName": "test",
"testEnvironment": "node",
"testPathIgnorePatterns": [
"<rootDir>/lib/.*",
"<rootDir>/src/rules/__tests__/fixtures/*"
"<rootDir>/src/rules/__tests__/fixtures/*",
"<rootDir>/src/rules/__tests__/test-utils.ts"
]
},
{
Expand Down Expand Up @@ -115,7 +115,6 @@
"lint-staged": "^11.1.2",
"pinst": "^2.0.0",
"prettier": "^2.0.5",
"resolve-from": "^5.0.0",
"rimraf": "^3.0.0",
"semantic-release": "^18.0.0",
"semver": "^7.3.5",
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/consistent-test-it.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../consistent-test-it';
import { TestCaseName } from '../utils';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/expect-expect.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import {
TSESLint,
} from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../expect-expect';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/max-nested-describe.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../max-nested-describe';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2017,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-commented-out-tests.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../no-commented-out-tests';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
sourceType: 'module',
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-conditional-expect.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../no-conditional-expect';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2019,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-disabled-tests.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../no-disabled-tests';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
sourceType: 'module',
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-done-callback.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../no-done-callback';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2017,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-duplicate-hooks.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../no-duplicate-hooks';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-export.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../no-export';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
sourceType: 'module',
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-focused-tests.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import resolveFrom from 'resolve-from';
import rule from '../no-focused-tests';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 6,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-hooks.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import resolveFrom from 'resolve-from';
import rule from '../no-hooks';
import { HookName } from '../utils';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-identical-title.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../no-identical-title';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-if.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../no-if';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-interpolation-in-snapshots.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import resolveFrom from 'resolve-from';
import rule from '../no-interpolation-in-snapshots';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2017,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-jest-import.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import resolveFrom from 'resolve-from';
import rule from '../no-jest-import';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-large-snapshots.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import resolveFrom from 'resolve-from';
import rule from '../no-large-snapshots';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-mocks-import.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import resolveFrom from 'resolve-from';
import rule from '../no-mocks-import';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-restricted-matchers.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import resolveFrom from 'resolve-from';
import rule from '../no-restricted-matchers';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2017,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-standalone-expect.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../no-standalone-expect';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/no-test-return-statement.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../no-test-return-statement';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: { ecmaVersion: 2015 },
});

Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/prefer-expect-assertions.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../prefer-expect-assertions';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2017,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/prefer-expect-resolves.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../prefer-expect-resolves';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2017,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/prefer-hooks-on-top.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../prefer-hooks-on-top';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/prefer-lowercase-title.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../prefer-lowercase-title';
import { DescribeAlias, TestCaseName } from '../utils';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/prefer-spy-on.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import {
AST_NODE_TYPES,
TSESLint,
} from '@typescript-eslint/experimental-utils';
import resolveFrom from 'resolve-from';
import rule from '../prefer-spy-on';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/prefer-to-have-length.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import resolveFrom from 'resolve-from';
import rule from '../prefer-to-have-length';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2015,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/prefer-todo.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../prefer-todo';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: { ecmaVersion: 2015 },
});

Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/require-hook.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../require-hook';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2017,
},
Expand Down
4 changes: 2 additions & 2 deletions src/rules/__tests__/require-to-throw-message.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { TSESLint } from '@typescript-eslint/experimental-utils';
import dedent from 'dedent';
import resolveFrom from 'resolve-from';
import rule from '../require-to-throw-message';
import { espreeParser } from './test-utils';

const ruleTester = new TSESLint.RuleTester({
parser: resolveFrom(require.resolve('eslint'), 'espree'),
parser: espreeParser,
parserOptions: {
ecmaVersion: 2017,
},
Expand Down
Loading

0 comments on commit 95a45c9

Please sign in to comment.