eslint-config-salesforce-typescript is a comprehensive ESLint configuration designed specifically for TypeScript projects within the Salesforce ecosystem. Currently at version 4.0.1, this package provides a curated set of ESLint rules, including those from `@typescript-eslint/eslint-plugin` and `@typescript-eslint/parser`, ensuring consistent code quality and adherence to Salesforce's coding standards for TypeScript. It offers a structured approach to linting, integrating best practices for TypeScript development, and helps prevent common issues. The package receives regular maintenance updates, often weekly or bi-weekly as evidenced by the release log, primarily focused on dependency bumps and minor rule adjustments. It differentiates itself by providing a ready-to-use setup tailored for Salesforce projects, abstracting away the complexity of configuring multiple ESLint plugins for TypeScript. Developers can extend this configuration in their `.eslintrc` files, simplifying the setup process for new and existing projects.
npm install eslint-config-salesforce-typescriptVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to install the configuration and its required peer dependencies, then set up a basic .eslintrc.js file to extend the Salesforce TypeScript ESLint rules.
Consult the project's GitHub repository or release notes for a full list of breaking changes and adjust your project's ESLint configuration and code accordingly.
Ensure all required peer dependencies, as listed in the documentation and during installation, are installed using your package manager (e.g., `yarn add ...` or `npm install ...`).
Add `parserOptions: { project: './tsconfig.json' }` to your `.eslintrc.js` file, adjusting the path to your primary `tsconfig.json` file relative to the ESLint config.Verify that `parserOptions.project` in your `.eslintrc` points to the correct `tsconfig.json` path and that your `tsconfig.json`'s `include` array covers the files being linted.
Install the missing plugin: `yarn add eslint-plugin-import` or `npm install eslint-plugin-import`.
Ensure your ESLint installation is up-to-date (`yarn add eslint@latest` or `npm install eslint@latest`). If using CommonJS, verify your `.eslintrc.js` uses `module.exports = { ... }` correctly. If in an ESM project, ensure your `.eslintrc.js` file name and contents are compatible with ESM, or consider using `.eslintrc.cjs`.