From fa9a21e49649bbeaba9695a78385494f5b22f149 Mon Sep 17 00:00:00 2001 From: Ben Perlmutter Date: Wed, 30 Nov 2022 20:14:35 -0500 Subject: [PATCH] add examples --- docs/src/user-guide/getting-started.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/src/user-guide/getting-started.md b/docs/src/user-guide/getting-started.md index 4d7794f7e85e..06c5b45bccf6 100644 --- a/docs/src/user-guide/getting-started.md +++ b/docs/src/user-guide/getting-started.md @@ -110,18 +110,34 @@ Before you begin, you must have a `package.json` file already. If you don't, mak 1. Add an `.eslintrc` file in one of the [supported configuration file formats](./configuring/configuration-files#configuration-file-formats). - TODO: add example shell commands for this + ```shell + # Create JavaScript configuration file + touch .eslintrc.js + ``` 1. Add configuration to the `.eslintrc` file. Refer to the [Configuring ESLint documentation](./configuring/) to learn how ot add rules, environments, custom configurations, plugins, and more. - TODO: show a sample configuration file using .js extension + ```js + // .eslintrc.js example + module.exports = { + "env": { + "browser": true, + "es2021": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + } + ``` 1. Lint code using the ESLint CLI: ```sh - npm run eslint + npm run eslint project-dir/ file1.js # OR - npx eslint + npx eslint project-dir/ file1.js ```