Отключение нескольких правил ESLint в одном комментарии
Периодически бывают ситуации, когда для конкретных участков JS-кода нужно отключить линтинг. Сделать это можно так:
— для следующей строки кода
— для следующей строки кода
#кодинг
#js
#eslint
Периодически бывают ситуации, когда для конкретных участков JS-кода нужно отключить линтинг. Сделать это можно так:
— для следующей строки кода
// eslint-disable-next-line no-return-assign
( your code... )
— для текущей строки( your code... ) // eslint-disable-line no-return-assign
— для блока кода/* eslint-disable no-return-assign */
( your code... )
/* eslint-enable no-return-assign */
В перечисленных примерах мы отключаем одно правило — no-return-assign
. Но что, если нам нужно отключить несколько правил помимо no-return-assign
, например, no-param-reassign
? Ответ прост: нужно просто перечислить их через запятую. Примеры:— для следующей строки кода
// eslint-disable-next-line no-return-assign, no-param-reassign
( your code... )
— для текущей строки( your code... ) // eslint-disable-line no-return-assign,
no-param-reassign
— для блока кода/* eslint-disable no-return-assign, no-param-reassign */
( your code... )
/* eslint-enable no-return-assign, no-param-reassign */
Подробнее о конфигурировании правил читайте здесь#кодинг
#js
#eslint
eslint.org
Configure ESLint - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
ESLint + Prettier + Typescript and React in 2022
https://blog.devgenius.io/eslint-prettier-typescript-and-react-in-2022-e5021ebca2b1
#coding
#react
#typescript
#eslint
#prettier
https://blog.devgenius.io/eslint-prettier-typescript-and-react-in-2022-e5021ebca2b1
#coding
#react
#typescript
#eslint
#prettier
Medium
ESLint + Prettier + Typescript and React in 2022
Making a new project ready for development can be a little overwhelming, especially if you use React, Typescript, ESLint, and Prettier
Automatically Format your code on Git Commit using Husky, ESLint, Prettier in 9 minutes
https://dev.to/ruppysuppy/automatically-format-your-code-on-git-commit-using-husky-eslint-prettier-in-9-minutes-45eg
#coding
#eslint
#prettier
#git
https://dev.to/ruppysuppy/automatically-format-your-code-on-git-commit-using-husky-eslint-prettier-in-9-minutes-45eg
#coding
#eslint
#prettier
#git
DEV Community
Automatically Format your code on Git Commit using Husky, ESLint, Prettier in 9 minutes
When collaborating on a project with several other developers, maintaining a consistent code style...
Set up a Node.js App with ESLint and Prettier
https://dev.to/devland/set-up-a-nodejs-app-with-eslint-and-prettier-4i7p
#coding
#node
#eslint
#prettier
https://dev.to/devland/set-up-a-nodejs-app-with-eslint-and-prettier-4i7p
#coding
#node
#eslint
#prettier
DEV Community
Set up a Node.js App with ESLint and Prettier
Before building an application, we first need to prepare the development environment with tools and...
Using ESLint and Prettier in a TypeScript Project
https://dev.to/robertcoopercode/using-eslint-and-prettier-in-a-typescript-project-53jb
#typescript
#node
#eslint
https://dev.to/robertcoopercode/using-eslint-and-prettier-in-a-typescript-project-53jb
#typescript
#node
#eslint
DEV Community
Using ESLint and Prettier in a TypeScript Project
ESLint's large set of linting rules and the increased commitment to use ESLint by the TypeScript team makes ESLint a great tool for linting TypeScript projects.