Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions packages/eslint-scope/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ import Referencer from "./referencer.js";
import Reference from "./reference.js";
import Variable from "./variable.js";

import eslintScopeVersion from "./version.js";

/**
* Set the default options
* @returns {Object} options
Expand Down Expand Up @@ -138,10 +136,10 @@ function analyze(tree, providedOptions) {
return scopeManager;
}

export {
/** @name module:escope.version */
export const version = "9.0.0"; // x-release-please-version

/** @name module:escope.version */
eslintScopeVersion as version,
export {

/** @name module:escope.Reference */
Reference,
Expand Down
12 changes: 0 additions & 12 deletions packages/eslint-scope/lib/version.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/eslint-scope/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
"license": "BSD-2-Clause",
"scripts": {
"build": "rollup -c",
"build:update-version": "node tools/update-version.js",
"prepublishOnly": "npm run build:update-version && npm run build",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're already running build before publishing:

- run: |
npm install
npm run build
if: ${{ steps.release.outputs.releases_created == 'true' }}

"pretest": "npm run build",
"test": "node Makefile.js test"
},
Expand Down
8 changes: 5 additions & 3 deletions packages/eslint-scope/tests/commonjs.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

const assert = require("node:assert");
const eslintScope = require("../dist/eslint-scope.cjs");

const { version } = require("../package.json");

//------------------------------------------------------------------------------
// Tests
Expand All @@ -22,9 +22,11 @@ describe("commonjs", () => {
assert.strictEqual(typeof eslintScope, "object");
});

it("has exports", () => {
assert.strictEqual(typeof eslintScope.version, "string");
it("has version equal to the version in package.json", () => {
assert.strictEqual(eslintScope.version, version);
});

it("has exports", () => {
[
"analyze",
"Definition",
Expand Down
29 changes: 29 additions & 0 deletions packages/eslint-scope/tests/version.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* @fileoverview Tests for version.
* @author Milos Djermanovic
*/

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

import { expect } from "chai";
import * as eslintScope from "../lib/index.js";
import { fileURLToPath } from "node:url";
import path from "node:path";
import fs from "node:fs";

// eslint-disable-next-line no-underscore-dangle -- Conventional
const __dirname = path.dirname(fileURLToPath(import.meta.url));

const { version } = JSON.parse(fs.readFileSync(`${__dirname}/../package.json`, "utf8"));

//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------

describe("version", () => {
it("should be equal to the version in package.json", () => {
expect(eslintScope.version).to.be.equal(version);
});
});
18 changes: 0 additions & 18 deletions packages/eslint-scope/tools/update-version.js

This file was deleted.

3 changes: 1 addition & 2 deletions packages/espree/espree.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
import * as acorn from "acorn";
import jsx from "acorn-jsx";
import espree from "./lib/espree.js";
import espreeVersion from "./lib/version.js";
import * as visitorKeys from "eslint-visitor-keys";
import { getLatestEcmaVersion, getSupportedEcmaVersions } from "./lib/options.js";

Expand Down Expand Up @@ -138,7 +137,7 @@ export function parse(code, options) {
// Public
//------------------------------------------------------------------------------

export const version = espreeVersion;
export const version = "11.0.0"; // x-release-please-version
export const name = "espree";

/* istanbul ignore next */
Expand Down
3 changes: 0 additions & 3 deletions packages/espree/lib/version.js

This file was deleted.

2 changes: 0 additions & 2 deletions packages/espree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@
"build": "rollup -c rollup.config.js",
"build:debug": "npm run build -- -m",
"build:docs": "node tools/sync-docs.js",
"build:update-version": "node tools/update-version.js",
"prepublishOnly": "npm run build:update-version && npm run build",
"pretest": "npm run build",
"test": "npm run test:cjs && npm run test:esm",
"test:cjs": "mocha --color --reporter progress --timeout 30000 \"tests/**/*.test.cjs\"",
Expand Down
5 changes: 3 additions & 2 deletions packages/espree/tests/lib/commonjs.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

const assert = require("node:assert");
const espree = require("../../dist/espree.cjs");
const { version } = require("../../package.json");


//------------------------------------------------------------------------------
Expand Down Expand Up @@ -56,8 +57,8 @@ describe("commonjs", () => {
assert.strictEqual(typeof espree.tokenize, "function");
});

it("has version", () => {
assert.strictEqual(typeof espree.version, "string");
it("has version equal to the version in package.json", () => {
assert.strictEqual(espree.version, version);
});

it("has Syntax", () => {
Expand Down
29 changes: 29 additions & 0 deletions packages/espree/tests/lib/version.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* @fileoverview Tests for version.
* @author Milos Djermanovic
*/

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

import * as espree from "../../espree.js";
import { fileURLToPath } from "node:url";
import path from "node:path";
import fs from "node:fs";
import assert from "node:assert";

// eslint-disable-next-line no-underscore-dangle -- Conventional
const __dirname = path.dirname(fileURLToPath(import.meta.url));

const { version } = JSON.parse(fs.readFileSync(`${__dirname}/../../package.json`, "utf8"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same note as #714 (comment).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in b08c10c


//------------------------------------------------------------------------------
// Tests
//------------------------------------------------------------------------------

describe("version", () => {
it("should be equal to the version in package.json", () => {
assert.strictEqual(espree.version, version);
});
});
18 changes: 0 additions & 18 deletions packages/espree/tools/update-version.js

This file was deleted.

6 changes: 4 additions & 2 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
"bump-minor-pre-major": true,
"packages": {
"packages/espree": {
"release-type": "node"
"release-type": "node",
"extra-files": ["espree.js"]
},
"packages/eslint-scope": {
"release-type": "node"
"release-type": "node",
"extra-files": ["lib/index.js"]
},
"packages/eslint-visitor-keys": {
"release-type": "node"
Expand Down