
Security News
Feross on TBPN: Socket's Series C and the State of Software Supply Chain Security
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.
eslint-plugin-local-rules
Advanced tools
A plugin for ESLint that allows you to use project-specific rules
A plugin for ESLint that allows you to use project-specific rules, similar to the deprecated --rulesdir command line option (more).
npm install eslint-plugin-local-rules
'use strict';
module.exports = {
'disallow-identifiers': {
meta: {
docs: {
description: 'disallow identifiers',
category: 'Possible Errors',
},
schema: [],
},
create: function (context) {
return {
Identifier: function (node) {
context.report({
node: node,
message: 'Identifiers not allowed for Super Important reasons.',
});
},
};
},
},
};
{
"plugins": ["local-rules"],
"extends": [
"plugin:local-rules/all"
]
}
{
"plugins": ["local-rules"],
"extends": [
"plugin:local-rules/all-warn"
]
}
{
"plugins": ["local-rules"],
"rules": {
"local-rules/disallow-identifiers": "error"
}
}
npm install ts-node @types/eslint
You'll also need an eslint config like the .eslintrc above (more info).
require("ts-node").register({
transpileOnly: true,
compilerOptions: {
module: "commonjs",
},
});
module.exports = require("./rules").default;
import type { Rule } from "eslint";
export default {
"disallow-identifiers": {
meta: {
docs: {
description: 'disallow identifiers',
category: 'Possible Errors',
},
schema: [],
},
create: function (context) {
return {
Identifier: function (node) {
context.report({
node: node,
message: 'Identifiers not allowed for Super Important reasons.',
});
},
};
},
},
} satisfies Record<string, Rule.RuleModule>;
This plugin supports npm/yarn/pnpm workspaces, although note that if the eslint-local-rules.js file is in the workspace subdirectory, running from the project root is unsupported.
For example, if there's an eslint-local-rules.js and index.js in ./src/app:
Wrong: npx eslint src/app/index.js
Right: (cd src/app; npx eslint index.js)
Also note that if there is an eslint-local-rules.js file in both the workspace subdirectory and project root, the workspace one takes precedence (assuming you're running eslint from the workspace directory, as above).
processorsMIT
FAQs
A plugin for ESLint that allows you to use project-specific rules
The npm package eslint-plugin-local-rules receives a total of 591,507 weekly downloads. As such, eslint-plugin-local-rules popularity was classified as popular.
We found that eslint-plugin-local-rules demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Feross Aboukhadijeh joins TBPN to discuss Socket's $60M Series C, 500%+ ARR growth, AI's impact on open source, and the rise in supply chain attacks.

Security News
OSV withdrew 157 OSV malware reports after automated false positives incorrectly flagged trusted npm and PyPI packages, sending bad records into tools that rely on OSV data.

Research
/Security News
TrapDoor crypto stealer hits 36 malicious packages across npm, PyPI, and Crates.io, targeting crypto, DeFi, AI, and security developers.