![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@tool-belt/eslint-config
Advanced tools
Comprehensive ESLint config for TypeScript based projects
@tool-belt/eslint-config
is a comprehensive ESLint configuration library designed to streamline the setup of ESLint
for various JavaScript and TypeScript projects. It includes support for React, Svelte, and Node.js environments and
integrates with Prettier for code formatting.
To install the library, use npm:
npm install @tool-belt/eslint-config
The createConfig
function generates an ESLint flat config based on the provided options. Below is an
example eslint.config.js
file using @tool-belt/eslint-config
:
import { createConfig } from '@tool-belt/eslint-config';
export default await createConfig();
The createConfig
function accepts an options object to customize the ESLint configuration. The available options are:
tsconfigRootDir
: The root directory of the TypeScript configuration. Default is .
.browser
: A boolean indicating if the configuration is for a browser environment. Default is false
.react
: A boolean indicating if the configuration is for a React project. Default is false
.svelte
: A boolean indicating if the configuration is for a Svelte project. Default is false
.project
: An array of paths to the TypeScript project configuration files. Default is ['./tsconfig.json']
.ecmaVersion
: The ECMAScript version to use. Default is 2024
.Additionally, you can pass any ParserOptions
from the ESLint configuration.
Here is an example of using createConfig
with custom options:
import { createConfig } from '@tool-belt/eslint-config';
const config = await createConfig({
tsconfigRootDir: './src',
browser: true,
react: true,
project: ['./tsconfig.app.json'],
ecmaVersion: 2021,
});
export default config;
The configuration provided by @tool-belt/eslint-config
includes rules and plugins from various ESLint plugins to
enforce best practices and coding standards.
eslint-plugin-jsdoc
: Enforces JSDoc comments.eslint-plugin-markdown
: Lints JavaScript code blocks within Markdown files.eslint-plugin-n
: Provides Node.js specific linting rules.eslint-plugin-prettier/recommended
: Integrates Prettier for code formatting.eslint-plugin-promise
: Enforces best practices for working with Promises.eslint-plugin-simple-import-sort
: Ensures import statements are sorted.eslint-plugin-unicorn
: Enforces various stylistic and best practice rules.eslint-plugin-unused-imports
: Removes unused imports.eslint-plugin-react
: Lints React code (when react
option is true).eslint-plugin-jsx-a11y
: Enforces accessibility rules for JSX (when react
option is true).eslint-plugin-svelte
: Lints Svelte code (when svelte
option is true).The following paths are ignored by default:
dist/
build/
.svelte-kit/
node_modules/
public/
The configuration includes strict and stylistic type-checking rules from @typescript-eslint
.
The configuration ensures compatibility with Prettier by including eslint-config-prettier
and eslint-plugin-prettier/recommended
.
If both react
and svelte
options are set to true
, an error is thrown:
throw new Error('Cannot use both react and svelte for the same configuration');
This project is open to contributions. Please read the Contributing Guidelines for more information.
FAQs
Comprehensive ESLint config for TypeScript based projects
We found that @tool-belt/eslint-config demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.