Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: use explicit path (extension) #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/find-variable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getInnermostScope } from "./get-innermost-scope"
import { getInnermostScope } from "./get-innermost-scope.js";

/**
* Find the variable of a given name.
Expand Down
2 changes: 1 addition & 1 deletion src/get-function-head-location.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isArrowToken, isOpeningParenToken } from "./token-predicate"
import { isArrowToken, isOpeningParenToken } from "./token-predicate.js"

/**
* Get the `(` token of the given function node.
Expand Down
2 changes: 1 addition & 1 deletion src/get-function-name-with-kind.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getPropertyName } from "./get-property-name"
import { getPropertyName } from "./get-property-name.js"

/**
* Get the name and kind of the given function node.
Expand Down
2 changes: 1 addition & 1 deletion src/get-property-name.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getStringIfConstant } from "./get-string-if-constant"
import { getStringIfConstant } from "./get-string-if-constant.js"

/**
* Get the property name from a MemberExpression node or a Property node.
Expand Down
2 changes: 1 addition & 1 deletion src/get-static-value.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* globals globalThis, global, self, window */

import { findVariable } from "./find-variable"
import { findVariable } from "./find-variable.js"

const globalObject =
typeof globalThis !== "undefined"
Expand Down
2 changes: 1 addition & 1 deletion src/get-string-if-constant.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getStaticValue } from "./get-static-value"
import { getStaticValue } from "./get-static-value.js"

/**
* Get the value of a given node if it's a literal or a template literal.
Expand Down
24 changes: 12 additions & 12 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { findVariable } from "./find-variable"
import { getFunctionHeadLocation } from "./get-function-head-location"
import { getFunctionNameWithKind } from "./get-function-name-with-kind"
import { getInnermostScope } from "./get-innermost-scope"
import { getPropertyName } from "./get-property-name"
import { getStaticValue } from "./get-static-value"
import { getStringIfConstant } from "./get-string-if-constant"
import { hasSideEffect } from "./has-side-effect"
import { isParenthesized } from "./is-parenthesized"
import { PatternMatcher } from "./pattern-matcher"
import { findVariable } from "./find-variable.js"
import { getFunctionHeadLocation } from "./get-function-head-location.js"
import { getFunctionNameWithKind } from "./get-function-name-with-kind.js"
import { getInnermostScope } from "./get-innermost-scope.js"
import { getPropertyName } from "./get-property-name.js"
import { getStaticValue } from "./get-static-value.js"
import { getStringIfConstant } from "./get-string-if-constant.js"
import { hasSideEffect } from "./has-side-effect.js"
import { isParenthesized } from "./is-parenthesized.js"
import { PatternMatcher } from "./pattern-matcher.js"
import {
CALL,
CONSTRUCT,
Expand Down Expand Up @@ -37,8 +37,8 @@ import {
isOpeningBraceToken,
isOpeningBracketToken,
isOpeningParenToken,
isSemicolonToken,
} from "./token-predicate"
isSemicolonToken
} from "./token-predicate.js"

export default {
CALL,
Expand Down
2 changes: 1 addition & 1 deletion src/is-parenthesized.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isClosingParenToken, isOpeningParenToken } from "./token-predicate"
import { isClosingParenToken, isOpeningParenToken } from "./token-predicate.js"

/**
* Get the left parenthesis of the parent node syntax if it exists.
Expand Down
6 changes: 3 additions & 3 deletions src/reference-tracker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { findVariable } from "./find-variable"
import { getPropertyName } from "./get-property-name"
import { getStringIfConstant } from "./get-string-if-constant"
import { findVariable } from "./find-variable.js"
import { getPropertyName } from "./get-property-name.js"
import { getStringIfConstant } from "./get-string-if-constant.js"

const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u
const has = Function.call.bind(Object.hasOwnProperty)
Expand Down
2 changes: 1 addition & 1 deletion test/find-variable.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from "assert"
import eslint from "eslint"
import { findVariable } from "../src/"
import { findVariable } from "../src/index.js"

describe("The 'findVariable' function", () => {
function getVariable(code, selector, withString = null) {
Expand Down
2 changes: 1 addition & 1 deletion test/get-function-head-location.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from "assert"
import eslint from "eslint"
import semver from "semver"
import { getFunctionHeadLocation } from "../src/"
import { getFunctionHeadLocation } from "../src/index.js"

describe("The 'getFunctionHeadLocation' function", () => {
const expectedResults = {
Expand Down
2 changes: 1 addition & 1 deletion test/get-function-name-with-kind.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from "assert"
import eslint from "eslint"
import semver from "semver"
import { getFunctionNameWithKind } from "../src/"
import { getFunctionNameWithKind } from "../src/index.js"

describe("The 'getFunctionNameWithKind' function", () => {
const expectedResults = {
Expand Down
2 changes: 1 addition & 1 deletion test/get-innermost-scope.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from "assert"
import eslint from "eslint"
import { getInnermostScope } from "../src/"
import { getInnermostScope } from "../src/index.js"

describe("The 'getInnermostScope' function", () => {
let i = 0
Expand Down
2 changes: 1 addition & 1 deletion test/get-property-name.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from "assert"
import eslint from "eslint"
import semver from "semver"
import { getPropertyName } from "../src/"
import { getPropertyName } from "../src/index.js"

describe("The 'getPropertyName' function", () => {
for (const { code, expected } of [
Expand Down
2 changes: 1 addition & 1 deletion test/get-static-value.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from "assert"
import eslint from "eslint"
import semver from "semver"
import { getStaticValue } from "../src/"
import { getStaticValue } from "../src/index.js"

describe("The 'getStaticValue' function", () => {
for (const { code, expected, noScope = false } of [
Expand Down
2 changes: 1 addition & 1 deletion test/get-string-if-constant.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from "assert"
import eslint from "eslint"
import { getStringIfConstant } from "../src/"
import { getStringIfConstant } from "../src/index.js"

describe("The 'getStringIfConstant' function", () => {
for (const { code, expected } of [
Expand Down
2 changes: 1 addition & 1 deletion test/has-side-effect.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import assert from "assert"
import eslint from "eslint"
import semver from "semver"
import dp from "dot-prop"
import { hasSideEffect } from "../src/"
import { hasSideEffect } from "../src/index.js"

describe("The 'hasSideEffect' function", () => {
for (const { code, key = "body.0.expression", options, expected } of [
Expand Down
2 changes: 1 addition & 1 deletion test/is-parenthesized.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from "assert"
import dotProp from "dot-prop"
import eslint from "eslint"
import { isParenthesized } from "../src/"
import { isParenthesized } from "../src/index.js"

describe("The 'isParenthesized' function", () => {
for (const { code, expected } of [
Expand Down
2 changes: 1 addition & 1 deletion test/pattern-matcher.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assert from "assert"
import { PatternMatcher } from "../src/"
import { PatternMatcher } from "../src/index.js"

const NAMED_CAPTURE_GROUP_SUPPORTED = (() => {
try {
Expand Down
2 changes: 1 addition & 1 deletion test/reference-tracker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from "assert"
import eslint from "eslint"
import semver from "semver"
import { CALL, CONSTRUCT, ESM, READ, ReferenceTracker } from "../src/"
import { CALL, CONSTRUCT, ESM, READ, ReferenceTracker } from "../src/index.js"

const config = {
parserOptions: {
Expand Down
4 changes: 2 additions & 2 deletions test/token-predicate.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import {
isOpeningBraceToken,
isOpeningBracketToken,
isOpeningParenToken,
isSemicolonToken,
} from "../src/"
isSemicolonToken
} from "../src/index.js"

describe("The predicate functions for tokens", () => {
for (const { positive, negative, patterns } of [
Expand Down