Skip to content

Commit

Permalink
feat(eslint): introduce @stylistic/padding-line-between-statements
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Oct 23, 2024
1 parent c01e877 commit 5754882
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
8 changes: 8 additions & 0 deletions cfg/eslint-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,5 +466,13 @@ module.exports = {
'@typescript-eslint/dot-notation': 0, // not always desireable
'@typescript-eslint/consistent-indexed-object-style': 0, // Record looses the name of the key
'@typescript-eslint/no-unsafe-enum-comparison': 0, // not practically helpful
// stylistic
'@stylistic/padding-line-between-statements': [
2,
{ blankLine: 'always', prev: 'function', next: '*' },
{ blankLine: 'always', prev: '*', next: 'function' },
{ blankLine: 'always', prev: 'class', next: '*' },
{ blankLine: 'always', prev: '*', next: 'class' },
],
},
}
1 change: 1 addition & 0 deletions cfg/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ function getConfig() {
// 'unused-imports': require('eslint-plugin-unused-imports'), // disabled in favor of biome rules
'simple-import-sort': require('eslint-plugin-simple-import-sort'),
jsdoc: require('eslint-plugin-jsdoc'),
'@stylistic': require('@stylistic/eslint-plugin'),
...(hasJest ? { jest: require('eslint-plugin-jest') } : {}),
},
languageOptions: {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@naturalcycles/cli": "^1.0.0",
"@naturalcycles/js-lib": "^14.0.0",
"@naturalcycles/nodejs-lib": "^13.0.1",
"@stylistic/eslint-plugin": "^2.9.0",
"@types/jest": "^29.0.0",
"@types/node": "^22.0.0",
"@types/yargs": "^16.0.0",
Expand Down
24 changes: 24 additions & 0 deletions src/test/cfg/eslint.config.dump.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"import-x",
"simple-import-sort:eslint-plugin-simple-import-sort@12.1.1",
"jsdoc",
"@stylistic",
"jest:eslint-plugin-jest@28.8.3"
],
"processor": "vue/vue",
Expand All @@ -34,6 +35,29 @@
"@babel/semi": [
0
],
"@stylistic/padding-line-between-statements": [
2,
{
"blankLine": "always",
"next": "*",
"prev": "function"
},
{
"blankLine": "always",
"next": "function",
"prev": "*"
},
{
"blankLine": "always",
"next": "*",
"prev": "class"
},
{
"blankLine": "always",
"next": "class",
"prev": "*"
}
],
"@typescript-eslint/adjacent-overload-signatures": [
2
],
Expand Down
20 changes: 18 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1119,6 +1119,17 @@
dependencies:
"@sinonjs/commons" "^3.0.0"

"@stylistic/eslint-plugin@^2.9.0":
version "2.9.0"
resolved "https://registry.yarnpkg.com/@stylistic/eslint-plugin/-/eslint-plugin-2.9.0.tgz#5ab3326303915e020ddaf39154290e2800a84bcd"
integrity sha512-OrDyFAYjBT61122MIY1a3SfEgy3YCMgt2vL4eoPmvTwDBwyQhAXurxNQznlRD/jESNfYWfID8Ej+31LljvF7Xg==
dependencies:
"@typescript-eslint/utils" "^8.8.0"
eslint-visitor-keys "^4.1.0"
espree "^10.2.0"
estraverse "^5.3.0"
picomatch "^4.0.2"

"@tsconfig/node10@^1.0.7":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2"
Expand Down Expand Up @@ -1349,7 +1360,7 @@
semver "^7.6.0"
ts-api-utils "^1.3.0"

"@typescript-eslint/utils@8.11.0", "@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/utils@^8.1.0":
"@typescript-eslint/utils@8.11.0", "@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/utils@^8.1.0", "@typescript-eslint/utils@^8.8.0":
version "8.11.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.11.0.tgz#4480d1e9f2bb18ea3510c79f870a1aefc118103d"
integrity sha512-CYiX6WZcbXNJV7UNB4PLDIBtSdRmRI/nb0FMyqHPTQD1rMjA0foPLaPUV39C/MxkTd/QKSeX+Gb34PPsDVC35g==
Expand Down Expand Up @@ -2281,7 +2292,7 @@ esrecurse@^4.3.0:
dependencies:
estraverse "^5.2.0"

estraverse@^5.1.0, estraverse@^5.2.0:
estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123"
integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==
Expand Down Expand Up @@ -3957,6 +3968,11 @@ picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1:
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==

picomatch@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab"
integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==

pidtree@~0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c"
Expand Down

0 comments on commit 5754882

Please sign in to comment.