This guide provides detailed instructions for installing CodeSense. You can use CodeSense in several ways: as a VS Code extension, a command-line interface (CLI), or an ESLint plugin.
The VS Code extension is the recommended way to use CodeSense for most users. It provides the most integrated experience.
- Visual Studio Code version 1.104.0 or newer.
- Open Visual Studio Code.
- Go to the Extensions view by clicking the Extensions icon in the Activity Bar on the side of the window or by pressing
Ctrl+Shift+X. - In the search bar, type
CodeSense. - Find the "CodeSense - Baseline Web Compatibility" extension and click the Install button.
The CLI is ideal for integrating CodeSense into your build process or CI/CD pipeline.
- Node.js (which includes npm) version 16 or newer.
For most users, we recommend installing the CodeSense CLI globally. This allows you to run the CodeSense command from any directory.
npm install -g CodeSenseIf you prefer to manage CodeSense as a project-specific dependency, you can install it locally.
npm install --save-dev CodeSenseWhen installed locally, you can run the CLI using npx:
npx CodeSenseThe ESLint plugin allows you to see CodeSense warnings directly in your editor as you code.
- ESLint version 8 or newer.
-
First, install the ESLint plugin:
npm install --save-dev eslint-plugin-CodeSense
-
Then, add the plugin to your ESLint configuration file (e.g.,
.eslintrc.js):module.exports = { // ... your other ESLint configuration plugins: ['CodeSense'], rules: { 'CodeSense/baseline-compatibility': 'error' } };
For more information on configuring the ESLint plugin, see the Configuration documentation.