Skip to content

Commit dc7433e

Browse files
committed
completed 4-th step of the project
1 parent 56397df commit dc7433e

File tree

5 files changed

+1143
-3
lines changed

5 files changed

+1143
-3
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ brain-games:
66

77
publish:
88
npm publish --dry-run
9+
10+
.PHONY: lint
11+
12+
lint:
13+
npx eslint .

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
### Hexlet tests and linter status:
2-
[![Actions Status](https://github.com/Michael57e/qa-auto-engineer-javascript-project-44/actions/workflows/hexlet-check.yml/badge.svg)](https://github.com/Michael57e/qa-auto-engineer-javascript-project-44/actions)
2+
[![Actions Status](https://github.com/Michael57e/qa-auto-engineer-javascript-project-44/actions/workflows/hexlet-check.yml/badge.svg)](https://github.com/Michael57e/qa-auto-engineer-javascript-project-44/actions)
3+
4+
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=Michael57e_qa-auto-engineer-javascript-project-44&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=Michael57e_qa-auto-engineer-javascript-project-44)

eslint.config.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// eslint.config.js
2+
import js from '@eslint/js';
3+
import globals from 'globals';
4+
5+
export default [
6+
// Игнорируем стандартные папки
7+
{ ignores: ['node_modules/', 'dist/', 'coverage/'] },
8+
9+
// Рекомендуемые правила от ESLint
10+
js.configs.recommended,
11+
12+
// Правила для всех JS-файлов проекта
13+
{
14+
files: ['**/*.js'],
15+
languageOptions: {
16+
ecmaVersion: 'latest',
17+
sourceType: 'module', // у тебя "type": "module" в package.json
18+
globals: { ...globals.node },
19+
},
20+
rules: {
21+
// мягкие настройки по умолчанию — при необходимости меняй
22+
'no-console': 'warn', // чтобы CLI-скрипты не ломались — настроим ниже override
23+
'indent': ['error', 2],
24+
'quotes': ['error', 'single', { avoidEscape: true }],
25+
'semi': ['error', 'always']
26+
},
27+
},
28+
29+
// Для исполняемых bin-скриптов (разрешаем console)
30+
{
31+
files: ['bin/**', 'src/cli.js'],
32+
languageOptions: {
33+
globals: { ...globals.node },
34+
},
35+
rules: {
36+
'no-console': 'off'
37+
}
38+
}
39+
];

0 commit comments

Comments
 (0)