![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
@eslint/core
Advanced tools
@eslint/core is the core library for ESLint, a tool for identifying and fixing problems in JavaScript code. It provides the core functionality needed to lint JavaScript code, including parsing, rule application, and reporting.
Linting JavaScript Code
This feature allows you to lint JavaScript files using ESLint. The code sample demonstrates how to use the ESLint class to lint files in a project, returning results that include any linting errors or warnings.
const { ESLint } = require("@eslint/core");
(async function main() {
const eslint = new ESLint();
const results = await eslint.lintFiles(["src/**/*.js"]);
console.log(results);
})();
Custom Rule Definition
This feature allows you to define custom linting rules. The code sample shows how to create a custom rule that reports an error when the identifier 'foo' is used, and how to apply this rule using ESLint.
const { ESLint } = require("@eslint/core");
const customRule = {
create(context) {
return {
Identifier(node) {
if (node.name === 'foo') {
context.report({ node, message: "Avoid using 'foo' as an identifier." });
}
}
};
}
};
(async function main() {
const eslint = new ESLint({
overrideConfig: {
rules: {
'no-foo': ['error', customRule]
}
}
});
const results = await eslint.lintText("const foo = 1;");
console.log(results);
})();
Configuring ESLint
This feature allows you to configure ESLint with specific environments, rules, and configurations. The code sample demonstrates how to set up ESLint with a custom configuration, including environment settings and specific rules.
const { ESLint } = require("@eslint/core");
(async function main() {
const eslint = new ESLint({
overrideConfig: {
env: {
browser: true,
node: true
},
extends: "eslint:recommended",
rules: {
semi: ["error", "always"]
}
}
});
const results = await eslint.lintFiles(["src/**/*.js"]);
console.log(results);
})();
JSHint is a static code analysis tool used to detect errors and potential problems in JavaScript code. It is similar to ESLint in that it provides linting capabilities, but it is generally considered less configurable and less extensible than ESLint.
TSLint is a linter for TypeScript, similar to ESLint but specifically designed for TypeScript. It has been deprecated in favor of using ESLint with TypeScript support, as ESLint provides a more flexible and extensible architecture.
Stylelint is a linter for CSS and other style-related languages. While it serves a different purpose than ESLint, it is similar in that it provides linting capabilities for a specific type of code, focusing on style sheets rather than JavaScript.
This package is the future home of the rewritten, runtime-agnostic ESLint core.
Right now, it exports the core types necessary to implement language plugins.
Apache 2.0
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. Become a Sponsor to get your logo on our READMEs and website.
FAQs
Runtime-agnostic core of ESLint
The npm package @eslint/core receives a total of 7,367,701 weekly downloads. As such, @eslint/core popularity was classified as popular.
We found that @eslint/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.