Skip to content

Commit da9b879

Browse files
firefoxicpepelsbey
andauthored
Обновляет ESLint до 9.0.0 (#358)
* Bump `eslint` to `9.0.0` * Переводит комменты --------- Co-authored-by: Vadim Makeev <[email protected]>
1 parent 5d9b53b commit da9b879

File tree

5 files changed

+261
-194
lines changed

5 files changed

+261
-194
lines changed

.eslintrc.json

Lines changed: 0 additions & 60 deletions
This file was deleted.

.remarkrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Typograf.addRules([
2525

2626
const re = new RegExp(
2727
`(^|\\s|${privateLabel})([а-яё]{1,3})\\. ?([а-яё]{1,3})\\.`,
28-
'g',
28+
'g'
2929
);
3030

3131
return (

eslint.config.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
const globals = require('globals');
2+
const js = require('@eslint/js');
3+
const stylisticJs = require('@stylistic/eslint-plugin-js');
4+
5+
module.exports = [
6+
js.configs.recommended,
7+
8+
// Глобальные переменные только для скриптов Node.js
9+
{
10+
ignores: ['src/scripts/**/*.js'],
11+
languageOptions: {
12+
globals: {
13+
// Заменить на ...globals.nodeBuiltin для ESM
14+
...globals.node,
15+
},
16+
},
17+
},
18+
19+
// Глобальные переменные только для браузерных скриптов
20+
{
21+
files: ['src/scripts/**/*.js'],
22+
languageOptions: {
23+
globals: {
24+
...globals.browser,
25+
},
26+
},
27+
},
28+
{
29+
plugins: {
30+
'@stylistic/js': stylisticJs,
31+
},
32+
rules: {
33+
'camelcase': ['error', { 'properties': 'never' }],
34+
'eqeqeq': 'error',
35+
'no-array-constructor': 'error',
36+
'no-empty': ['error', { 'allowEmptyCatch': true }],
37+
'no-console': 'warn',
38+
'no-const-assign': 'error',
39+
'no-duplicate-imports': 'error',
40+
'no-debugger': 'error',
41+
'no-invalid-regexp': 'error',
42+
'no-redeclare': ['error', { 'builtinGlobals': false }],
43+
'no-unneeded-ternary': 'error',
44+
45+
// Стилистические правила из плагина
46+
'@stylistic/js/arrow-spacing': 'error',
47+
'@stylistic/js/block-spacing': ['error', 'always'],
48+
'@stylistic/js/brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
49+
'@stylistic/js/comma-dangle': ['error', {
50+
'arrays': 'always-multiline',
51+
'objects': 'always-multiline',
52+
'imports': 'never',
53+
'exports': 'never',
54+
'functions': 'never',
55+
}],
56+
'@stylistic/js/comma-spacing': ['error', { 'before': false, 'after': true }],
57+
'@stylistic/js/comma-style': ['error', 'last'],
58+
'@stylistic/js/dot-location': ['error', 'property'],
59+
'@stylistic/js/eol-last': 'error',
60+
'@stylistic/js/function-call-spacing': ['error', 'never'],
61+
'@stylistic/js/indent': ['error', 4, {
62+
'SwitchCase': 1,
63+
'ignoredNodes': ['TemplateLiteral *'],
64+
}],
65+
'@stylistic/js/keyword-spacing': 'error',
66+
'@stylistic/js/key-spacing': ['error', { 'beforeColon': false, 'afterColon': true }],
67+
'@stylistic/js/linebreak-style': ['error', 'unix'],
68+
'@stylistic/js/no-multi-spaces': 'error',
69+
'@stylistic/js/no-whitespace-before-property': 'error',
70+
'@stylistic/js/padded-blocks': ['error', 'never'],
71+
'@stylistic/js/quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
72+
'@stylistic/js/rest-spread-spacing': ['error', 'never'],
73+
'@stylistic/js/semi': ['error', 'always'],
74+
'@stylistic/js/semi-spacing': ['error', { 'before': false, 'after': true }],
75+
'@stylistic/js/space-infix-ops': ['error', { 'int32Hint': false }],
76+
'@stylistic/js/space-before-function-paren': ['error', 'never'],
77+
'@stylistic/js/space-before-blocks': ['error', 'always'],
78+
'@stylistic/js/space-in-parens': ['error', 'never'],
79+
'@stylistic/js/spaced-comment': 'error',
80+
'@stylistic/js/template-curly-spacing': ['error', 'never'],
81+
},
82+
},
83+
];

0 commit comments

Comments
 (0)