DEV: Update linting and add types (#64)

This commit is contained in:
Jarek Radosz 2026-01-29 16:11:27 +01:00 committed by GitHub
parent 174b04a46b
commit e18612da05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 1023 additions and 557 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
node_modules
.discourse-site
.eslintcache

View File

@ -1,14 +1,14 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (8.0.3)
activesupport (8.1.2)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
json
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
@ -16,29 +16,29 @@ GEM
uri (>= 0.13.1)
ast (2.4.3)
base64 (0.3.0)
benchmark (0.4.1)
bigdecimal (3.3.0)
concurrent-ruby (1.3.5)
connection_pool (2.5.4)
bigdecimal (4.0.1)
concurrent-ruby (1.3.6)
connection_pool (3.0.2)
drb (2.2.3)
i18n (1.14.7)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
json (2.15.1)
json (2.18.0)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
logger (1.7.0)
minitest (5.26.0)
minitest (6.0.1)
prism (~> 1.5)
parallel (1.27.0)
parser (3.3.9.0)
parser (3.3.10.1)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
prism (1.5.1)
prism (1.9.0)
racc (1.8.1)
rack (3.2.3)
rack (3.2.4)
rainbow (3.1.1)
regexp_parser (2.11.3)
rubocop (1.81.1)
rubocop (1.84.0)
json (~> 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
@ -46,37 +46,39 @@ GEM
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.47.1)
rubocop-ast (1.49.0)
parser (>= 3.3.7.2)
prism (~> 1.4)
prism (~> 1.7)
rubocop-capybara (2.22.1)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-discourse (3.13.3)
rubocop-discourse (3.14.0)
activesupport (>= 6.1)
lint_roller (>= 1.1.0)
rubocop (>= 1.73.2)
rubocop-capybara (>= 2.22.0)
rubocop-discourse-base (>= 1.0.0)
rubocop-factory_bot (>= 2.27.0)
rubocop-rails (>= 2.30.3)
rubocop-rspec (>= 3.0.1)
rubocop-rspec_rails (>= 2.31.0)
rubocop-factory_bot (2.27.1)
rubocop-discourse-base (1.0.0)
rubocop (>= 1.80.0)
rubocop-factory_bot (2.28.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rails (2.33.4)
rubocop-rails (2.34.3)
activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1)
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.44.0, < 2.0)
rubocop-rspec (3.7.0)
rubocop-rspec (3.9.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rspec_rails (2.31.0)
rubocop (~> 1.81)
rubocop-rspec_rails (2.32.0)
lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rspec (~> 3.5)
@ -88,8 +90,8 @@ GEM
concurrent-ruby (~> 1.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.1.0)
uri (1.0.4)
unicode-emoji (4.2.0)
uri (1.1.1)
PLATFORMS
arm64-darwin-23
@ -100,4 +102,4 @@ DEPENDENCIES
syntax_tree
BUNDLED WITH
2.7.2
4.0.4

View File

@ -21,7 +21,7 @@
.user-card-directory {
display: grid;
grid-template-columns: 1fr;
grid-gap: 100px 20px;
gap: 100px 20px;
margin-top: 60px;
@media only screen and (width >= 500px) {

View File

@ -1,17 +1,33 @@
{
"private": true,
"devDependencies": {
"@discourse/lint-configs": "2.32.0",
"ember-template-lint": "7.9.1",
"eslint": "9.37.0",
"prettier": "3.6.2",
"stylelint": "16.25.0"
"@discourse/lint-configs": "2.37.2",
"@glint/ember-tsc": "1.0.9",
"concurrently": "^9.2.1",
"discourse": "npm:@discourse/types@2026.1.0-2709d36",
"ember-template-lint": "7.9.3",
"eslint": "9.39.2",
"prettier": "3.8.0",
"stylelint": "17.0.0"
},
"scripts": {
"lint": "concurrently \"pnpm:lint:*(!fix)\" --names \"lint:\"",
"lint:fix": "concurrently \"pnpm:lint:*:fix\" --names \"fix:\"",
"lint:css": "pnpm stylelint {javascripts,desktop,mobile,common,scss}/**/*.scss --allow-empty-input",
"lint:css:fix": "pnpm stylelint {javascripts,desktop,mobile,common,scss}/**/*.scss --fix --allow-empty-input",
"lint:js": "eslint {javascripts,test} --cache --no-error-on-unmatched-pattern",
"lint:js:fix": "eslint {javascripts,test} --fix --no-error-on-unmatched-pattern",
"lint:hbs": "ember-template-lint javascripts/**/*.gjs --no-error-on-unmatched-pattern",
"lint:hbs:fix": "ember-template-lint javascripts/**/*.gjs --fix --no-error-on-unmatched-pattern",
"lint:prettier": "pnpm prettier {javascripts,desktop,mobile,common,scss}/**/*.scss {javascripts,test}/**/*.{js,gjs} --check --no-error-on-unmatched-pattern",
"lint:prettier:fix": "pnpm prettier {javascripts,desktop,mobile,common,scss}/**/*.scss {javascripts,test}/**/*.{js,gjs} -w --no-error-on-unmatched-pattern",
"lint:types": "ember-tsc -b"
},
"engines": {
"node": ">= 22",
"npm": "please-use-pnpm",
"yarn": "please-use-pnpm",
"pnpm": "9.x"
"pnpm": "^10"
},
"packageManager": "pnpm@9.15.5"
"packageManager": "pnpm@10.28.0"
}

1469
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true
RSpec.describe "Core features", type: :system do
RSpec.describe "Core features" do
before { upload_theme_or_component }
it_behaves_like "having working core features"

22
tsconfig.json Normal file
View File

@ -0,0 +1,22 @@
{
"extends": "discourse/tsconfig-plugin",
"include": [
"javascripts/**/*",
"migrations/**/*",
"test/**/*",
"node_modules/discourse/declarations/**/*"
],
"compilerOptions": {
"paths": {
"admin/*": ["./node_modules/discourse/declarations/admin/*"],
"float-kit/*": ["./node_modules/discourse/declarations/float-kit/*"],
"select-kit/*": ["./node_modules/discourse/declarations/select-kit/*"],
"truth-helpers": [
"./node_modules/discourse/declarations/truth-helpers/index.d.ts"
],
"truth-helpers/*": [
"./node_modules/discourse/declarations/truth-helpers/*"
]
}
}
}