Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,6 @@ export default defineConfig([
"no-underscore-dangle": "off",
},
},
{
files: ["packages/eslint-scope/Makefile.js"],
languageOptions: {
globals: {
...globals.shelljs,
target: false,
},
},
rules: {
"no-console": "off",

@lumirlumir lumirlumir Jul 7, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As "no-console": "off" is also specified in the following config object, I removed it entirely, since shelljs is no longer used in eslint-scope, as noted in #757 (comment).

js/eslint.config.js

Lines 84 to 90 in db0b9e4

{
files: ["**/tools/**"],
rules: {
"no-console": "off",
"n/no-process-exit": "off",
},
},

},
},
{
files: ["packages/eslint-scope/**"],
linterOptions: {
Expand Down
131 changes: 0 additions & 131 deletions packages/eslint-scope/Makefile.js

This file was deleted.

9 changes: 5 additions & 4 deletions packages/eslint-scope/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
"build": "rollup -c",
"lint:types": "attw --pack",
"pretest": "npm run build",
"test": "npm run test:types && npm run test:unit",
"test": "npm run test:types && npm run test:unit && npm run test:licenses",
"test:coverage": "c8 npm run test:unit",
"test:licenses": "node tools/check-licenses.js",
"test:types": "tsc -p tsconfig.json && tsc -p tests/types/tsconfig.json",
"test:unit": "node Makefile.js test"
"test:unit": "mocha \"tests/**/*.test.{js,cjs}\""
},
"files": [
"LICENSE",
Expand All @@ -61,7 +63,6 @@
"eslint": "^10.4.0",
"eslint-visitor-keys": "^5.0.1",
"espree": "^11.2.0",
"npm-license": "^0.3.3",
"shelljs": "^0.10.0"
"npm-license": "^0.3.3"
}
}
80 changes: 80 additions & 0 deletions packages/eslint-scope/tools/check-licenses.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/**
* @fileoverview Build file
* @author nzakas
* @copyright OpenJS Foundation and other contributors, https://openjsf.org/
* MIT License
*/

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

import { fileURLToPath } from "node:url";
import checker from "npm-license";

//------------------------------------------------------------------------------
// Settings
//------------------------------------------------------------------------------

const OPEN_SOURCE_LICENSES = [
/MIT/u,
/BSD/u,
/Apache/u,
/ISC/u,
/WTF/u,
/Public Domain/u,
];

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
* Returns true if the given dependency's licenses are all permissable for use in OSS
* @param {Object} dependency object containing the name and licenses of the given dependency
* @returns {boolean} is permissable dependency
*/
function isPermissible(dependency) {
const licenses = dependency.licenses;

if (Array.isArray(licenses)) {
return licenses.some(license =>
isPermissible({
name: dependency.name,
licenses: license,
}),
);
}

return OPEN_SOURCE_LICENSES.some(license => license.test(licenses));
}

//------------------------------------------------------------------------------
// License Checking
//------------------------------------------------------------------------------

checker.init(
{
start: fileURLToPath(new URL("..", import.meta.url)),
meta: "./tools/licenses-meta-data.json",
},
deps => {
const impermissible = Object.keys(deps)
.map(dependency => ({
name: dependency,
licenses: deps[dependency].licenses,
}))
.filter(dependency => !isPermissible(dependency));

if (impermissible.length) {
impermissible.forEach(dependency => {
console.error(
"%s license for %s is impermissible.",
dependency.licenses,
dependency.name,
);
});
process.exitCode = 1;
}
},
);
2 changes: 1 addition & 1 deletion packages/eslint-visitor-keys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/latest/con

### Development commands

- `npm test` runs tests and measures code coverage.
- `npm test` runs tests.
- `npm run lint` checks source codes with ESLint.
- `npm run test:coverage` runs tests and generates code coverage report.

Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-visitor-keys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"test": "npm run test:types && npm run test:unit",
"test:coverage": "c8 npm run test:unit",
"test:types": "tsd",
"test:unit": "mocha \"tests/**/*.test.cjs\" && mocha \"tests/**/*.test.js\""
"test:unit": "mocha \"tests/**/*.test.{js,cjs}\""
},
"repository": {
"type": "git",
Expand Down
5 changes: 2 additions & 3 deletions packages/espree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,9 @@
"lint:types": "attw --pack",
"pretest": "npm run build",
"test": "npm run test:types && npm run test:unit",
"test:cjs": "mocha --color --reporter progress --timeout 30000 \"tests/**/*.test.cjs\"",
"test:esm": "c8 mocha --color --reporter progress --timeout 30000 \"tests/**/*.test.js\"",
"test:coverage": "c8 npm run test:unit",
"test:types": "tsd --typings dist/espree.d.ts",
"test:unit": "npm run test:cjs && npm run test:esm"
"test:unit": "mocha \"tests/**/*.test.{js,cjs}\""
},
"sideEffects": false
}
Loading