From ec28c7378b6e972ae550c4b022702e23686dbd34 Mon Sep 17 00:00:00 2001 From: Kelv Date: Thu, 17 Oct 2024 17:06:38 +0800 Subject: [PATCH] DEV: Update linting setup (#59) --- .rubocop.yml | 2 + .streerc | 2 + Gemfile | 8 +++ Gemfile.lock | 87 ++++++++++++++++++++++++++++++++ package.json | 2 +- pnpm-lock.yaml | 131 ++++++++++++++++++++++++++++--------------------- 6 files changed, 175 insertions(+), 57 deletions(-) create mode 100644 .rubocop.yml create mode 100644 .streerc create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..fb14dfa --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,2 @@ +inherit_gem: + rubocop-discourse: stree-compat.yml diff --git a/.streerc b/.streerc new file mode 100644 index 0000000..5c47737 --- /dev/null +++ b/.streerc @@ -0,0 +1,2 @@ +--print-width=100 +--plugins=plugin/trailing_comma,plugin/disable_auto_ternary diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..31d8bf7 --- /dev/null +++ b/Gemfile @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +group :development do + gem "rubocop-discourse" + gem "syntax_tree" +end diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..1d894dc --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,87 @@ +GEM + remote: https://rubygems.org/ + specs: + activesupport (7.2.1.1) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + ast (2.4.2) + base64 (0.2.0) + bigdecimal (3.1.8) + concurrent-ruby (1.3.4) + connection_pool (2.4.1) + drb (2.2.1) + i18n (1.14.6) + concurrent-ruby (~> 1.0) + json (2.7.2) + language_server-protocol (3.17.0.3) + logger (1.6.1) + minitest (5.25.1) + parallel (1.26.3) + parser (3.3.5.0) + ast (~> 2.4.1) + racc + prettier_print (1.2.1) + racc (1.8.1) + rack (3.1.8) + rainbow (3.1.1) + regexp_parser (2.9.2) + rubocop (1.67.0) + json (~> 2.3) + language_server-protocol (>= 3.17.0) + parallel (~> 1.10) + parser (>= 3.3.0.2) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 2.4, < 3.0) + rubocop-ast (>= 1.32.2, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.32.3) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) + rubocop (~> 1.41) + rubocop-discourse (3.8.2) + activesupport (>= 6.1) + rubocop (>= 1.59.0) + rubocop-capybara (>= 2.0.0) + rubocop-factory_bot (>= 2.0.0) + rubocop-rails (>= 2.25.0) + rubocop-rspec (>= 3.0.1) + rubocop-rspec_rails (>= 2.30.0) + rubocop-factory_bot (2.26.1) + rubocop (~> 1.61) + rubocop-rails (2.26.2) + activesupport (>= 4.2.0) + rack (>= 1.1) + rubocop (>= 1.52.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (3.1.0) + rubocop (~> 1.61) + rubocop-rspec_rails (2.30.0) + rubocop (~> 1.61) + rubocop-rspec (~> 3, >= 3.0.1) + ruby-progressbar (1.13.0) + securerandom (0.3.1) + syntax_tree (6.2.0) + prettier_print (>= 1.2.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + unicode-display_width (2.6.0) + +PLATFORMS + arm64-darwin-23 + ruby + +DEPENDENCIES + rubocop-discourse + syntax_tree + +BUNDLED WITH + 2.5.21 diff --git a/package.json b/package.json index a4caa0b..1872fa5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "devDependencies": { - "@discourse/lint-configs": "1.3.10", + "@discourse/lint-configs": "1.4.2", "ember-template-lint": "6.0.0", "eslint": "8.57.1", "prettier": "2.8.8", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c6ff644..bb5129d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,10 +10,10 @@ importers: devDependencies: '@babel/plugin-proposal-decorators': specifier: ^7.25.7 - version: 7.25.7(@babel/core@7.25.7) + version: 7.25.7(@babel/core@7.25.8) '@discourse/lint-configs': - specifier: 1.3.10 - version: 1.3.10(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8) + specifier: 1.4.2 + version: 1.4.2(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8) ember-template-lint: specifier: 6.0.0 version: 6.0.0 @@ -38,12 +38,12 @@ packages: resolution: {integrity: sha512-9ickoLz+hcXCeh7jrcin+/SLWm+GkxE2kTvoYyp38p4WkdFXfQJxDFGWp/YHjiKLPx06z2A7W8XKuqbReXDzsw==} engines: {node: '>=6.9.0'} - '@babel/core@7.25.7': - resolution: {integrity: sha512-yJ474Zv3cwiSOO9nXJuqzvwEeM+chDuQ8GJirw+pZ91sCGCyOZ3dJkVE09fTV0VEVzXyLWhh3G/AolYTPX7Mow==} + '@babel/core@7.25.8': + resolution: {integrity: sha512-Oixnb+DzmRT30qu9d3tJSQkxuygWm32DFykT4bRoORPa9hZ/L4KhVB/XiRm6KG+roIEM7DBQlmg27kw2HZkdZg==} engines: {node: '>=6.9.0'} - '@babel/eslint-parser@7.25.7': - resolution: {integrity: sha512-B+BO9x86VYsQHimucBAL1fxTJKF4wyKY6ZVzee9QgzdZOUfs3BaR6AQrgoGrRI+7IFS1wUz/VyQ+SoBcSpdPbw==} + '@babel/eslint-parser@7.25.8': + resolution: {integrity: sha512-Po3VLMN7fJtv0nsOjBDSbO1J71UhzShE9MuOSkWEV9IZQXzhZklYtzKZ8ZD/Ij3a0JBv1AG3Ny2L3jvAHQVOGg==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} peerDependencies: '@babel/core': ^7.11.0 @@ -128,6 +128,11 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/parser@7.25.8': + resolution: {integrity: sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==} + engines: {node: '>=6.0.0'} + hasBin: true + '@babel/plugin-proposal-decorators@7.25.7': resolution: {integrity: sha512-q1mqqqH0e1lhmsEQHV5U8OmdueBC2y0RFr2oUzZoFRtN3MvPmt2fsFRcNQAoGLTSNdHBFUYGnlgcRFhkBbKjPw==} engines: {node: '>=6.9.0'} @@ -152,11 +157,15 @@ packages: resolution: {integrity: sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==} engines: {node: '>=6.9.0'} - '@discourse/lint-configs@1.3.10': - resolution: {integrity: sha512-PQ56xx4UfceLR/wJm7ig1JRNKkLVYPAeyp5bV6k6jQhpVr9TeZdobeCfGbVtKG6hhuaQ4aECPjRf/MoNw00/cw==} + '@babel/types@7.25.8': + resolution: {integrity: sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==} + engines: {node: '>=6.9.0'} + + '@discourse/lint-configs@1.4.2': + resolution: {integrity: sha512-AhwEfqy7ByheuNEhioXlkcgrbvzQY8yFbSWwtqAB0GXsp4UNaMZFyjdMoPFgaUDdUzjY/eKFFZ/j4FkA9EY4qA==} peerDependencies: ember-template-lint: 6.0.0 - eslint: 8.57.0 + eslint: 8.57.1 prettier: 2.8.8 '@ember-data/rfc395-data@0.0.4': @@ -923,8 +932,8 @@ packages: resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} - globals@15.10.0: - resolution: {integrity: sha512-tqFIbz83w4Y5TCbtgjZjApohbuh7K9BxGYFm7ifwDR240tvdb7P9x+/9VvUKlmkPoiknoJtanI8UOrqxS3a7lQ==} + globals@15.11.0: + resolution: {integrity: sha512-yeyNSjdbyVaWurlwCpcA6XNBrHTMIeDdj0/hnvX/OLJ9ekOXYbLsLinH/MucQyGvNnXhidTdNhTtJaffL2sMfw==} engines: {node: '>=18'} globalthis@1.0.4: @@ -1650,8 +1659,8 @@ packages: resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} engines: {node: '>= 0.4'} - typescript@5.6.2: - resolution: {integrity: sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==} + typescript@5.6.3: + resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} engines: {node: '>=14.17'} hasBin: true @@ -1774,18 +1783,18 @@ snapshots: '@babel/compat-data@7.25.7': {} - '@babel/core@7.25.7': + '@babel/core@7.25.8': dependencies: '@ampproject/remapping': 2.3.0 '@babel/code-frame': 7.25.7 '@babel/generator': 7.25.7 '@babel/helper-compilation-targets': 7.25.7 - '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.7) + '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.8) '@babel/helpers': 7.25.7 - '@babel/parser': 7.25.7 + '@babel/parser': 7.25.8 '@babel/template': 7.25.7 '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 + '@babel/types': 7.25.8 convert-source-map: 2.0.0 debug: 4.3.7 gensync: 1.0.0-beta.2 @@ -1794,9 +1803,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/eslint-parser@7.25.7(@babel/core@7.25.7)(eslint@8.57.1)': + '@babel/eslint-parser@7.25.8(@babel/core@7.25.8)(eslint@8.57.1)': dependencies: - '@babel/core': 7.25.7 + '@babel/core': 7.25.8 '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 eslint: 8.57.1 eslint-visitor-keys: 2.1.0 @@ -1821,13 +1830,13 @@ snapshots: lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.25.7(@babel/core@7.25.7)': + '@babel/helper-create-class-features-plugin@7.25.7(@babel/core@7.25.8)': dependencies: - '@babel/core': 7.25.7 + '@babel/core': 7.25.8 '@babel/helper-annotate-as-pure': 7.25.7 '@babel/helper-member-expression-to-functions': 7.25.7 '@babel/helper-optimise-call-expression': 7.25.7 - '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.7) + '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.8) '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 '@babel/traverse': 7.25.7 semver: 6.3.1 @@ -1844,13 +1853,13 @@ snapshots: '@babel/helper-module-imports@7.25.7': dependencies: '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 + '@babel/types': 7.25.8 transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@7.25.7(@babel/core@7.25.7)': + '@babel/helper-module-transforms@7.25.7(@babel/core@7.25.8)': dependencies: - '@babel/core': 7.25.7 + '@babel/core': 7.25.8 '@babel/helper-module-imports': 7.25.7 '@babel/helper-simple-access': 7.25.7 '@babel/helper-validator-identifier': 7.25.7 @@ -1864,9 +1873,9 @@ snapshots: '@babel/helper-plugin-utils@7.25.7': {} - '@babel/helper-replace-supers@7.25.7(@babel/core@7.25.7)': + '@babel/helper-replace-supers@7.25.7(@babel/core@7.25.8)': dependencies: - '@babel/core': 7.25.7 + '@babel/core': 7.25.8 '@babel/helper-member-expression-to-functions': 7.25.7 '@babel/helper-optimise-call-expression': 7.25.7 '@babel/traverse': 7.25.7 @@ -1876,7 +1885,7 @@ snapshots: '@babel/helper-simple-access@7.25.7': dependencies: '@babel/traverse': 7.25.7 - '@babel/types': 7.25.7 + '@babel/types': 7.25.8 transitivePeerDependencies: - supports-color @@ -1896,7 +1905,7 @@ snapshots: '@babel/helpers@7.25.7': dependencies: '@babel/template': 7.25.7 - '@babel/types': 7.25.7 + '@babel/types': 7.25.8 '@babel/highlight@7.25.7': dependencies: @@ -1909,18 +1918,22 @@ snapshots: dependencies: '@babel/types': 7.25.7 - '@babel/plugin-proposal-decorators@7.25.7(@babel/core@7.25.7)': + '@babel/parser@7.25.8': dependencies: - '@babel/core': 7.25.7 - '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.7) + '@babel/types': 7.25.8 + + '@babel/plugin-proposal-decorators@7.25.7(@babel/core@7.25.8)': + dependencies: + '@babel/core': 7.25.8 + '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.8) '@babel/helper-plugin-utils': 7.25.7 - '@babel/plugin-syntax-decorators': 7.25.7(@babel/core@7.25.7) + '@babel/plugin-syntax-decorators': 7.25.7(@babel/core@7.25.8) transitivePeerDependencies: - supports-color - '@babel/plugin-syntax-decorators@7.25.7(@babel/core@7.25.7)': + '@babel/plugin-syntax-decorators@7.25.7(@babel/core@7.25.8)': dependencies: - '@babel/core': 7.25.7 + '@babel/core': 7.25.8 '@babel/helper-plugin-utils': 7.25.7 '@babel/template@7.25.7': @@ -1947,22 +1960,28 @@ snapshots: '@babel/helper-validator-identifier': 7.25.7 to-fast-properties: 2.0.0 - '@discourse/lint-configs@1.3.10(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8)': + '@babel/types@7.25.8': + dependencies: + '@babel/helper-string-parser': 7.25.7 + '@babel/helper-validator-identifier': 7.25.7 + to-fast-properties: 2.0.0 + + '@discourse/lint-configs@1.4.2(ember-template-lint@6.0.0)(eslint@8.57.1)(prettier@2.8.8)': dependencies: - '@babel/core': 7.25.7 - '@babel/eslint-parser': 7.25.7(@babel/core@7.25.7)(eslint@8.57.1) - '@babel/plugin-proposal-decorators': 7.25.7(@babel/core@7.25.7) + '@babel/core': 7.25.8 + '@babel/eslint-parser': 7.25.8(@babel/core@7.25.8)(eslint@8.57.1) + '@babel/plugin-proposal-decorators': 7.25.7(@babel/core@7.25.8) ember-template-lint: 6.0.0 eslint: 8.57.1 - eslint-plugin-decorator-position: 5.0.2(@babel/eslint-parser@7.25.7(@babel/core@7.25.7)(eslint@8.57.1))(eslint@8.57.1) - eslint-plugin-ember: 12.2.1(@babel/core@7.25.7)(eslint@8.57.1) + eslint-plugin-decorator-position: 5.0.2(@babel/eslint-parser@7.25.8(@babel/core@7.25.8)(eslint@8.57.1))(eslint@8.57.1) + eslint-plugin-ember: 12.2.1(@babel/core@7.25.8)(eslint@8.57.1) eslint-plugin-qunit: 8.1.2(eslint@8.57.1) eslint-plugin-simple-import-sort: 12.1.1(eslint@8.57.1) eslint-plugin-sort-class-members: 1.20.0(eslint@8.57.1) - globals: 15.10.0 + globals: 15.11.0 prettier: 2.8.8 prettier-plugin-ember-template-tag: 0.3.2 - typescript: 5.6.2 + typescript: 5.6.3 transitivePeerDependencies: - '@typescript-eslint/parser' - supports-color @@ -2584,10 +2603,10 @@ snapshots: transitivePeerDependencies: - supports-color - ember-eslint-parser@0.5.2(@babel/core@7.25.7)(eslint@8.57.1): + ember-eslint-parser@0.5.2(@babel/core@7.25.8)(eslint@8.57.1): dependencies: - '@babel/core': 7.25.7 - '@babel/eslint-parser': 7.25.7(@babel/core@7.25.7)(eslint@8.57.1) + '@babel/core': 7.25.8 + '@babel/eslint-parser': 7.25.8(@babel/core@7.25.8)(eslint@8.57.1) '@glimmer/syntax': 0.92.3 content-tag: 2.0.2 eslint-scope: 7.2.2 @@ -2735,24 +2754,24 @@ snapshots: eslint-formatter-kakoune@1.0.0: {} - eslint-plugin-decorator-position@5.0.2(@babel/eslint-parser@7.25.7(@babel/core@7.25.7)(eslint@8.57.1))(eslint@8.57.1): + eslint-plugin-decorator-position@5.0.2(@babel/eslint-parser@7.25.8(@babel/core@7.25.8)(eslint@8.57.1))(eslint@8.57.1): dependencies: - '@babel/core': 7.25.7 - '@babel/plugin-proposal-decorators': 7.25.7(@babel/core@7.25.7) + '@babel/core': 7.25.8 + '@babel/plugin-proposal-decorators': 7.25.7(@babel/core@7.25.8) '@ember-data/rfc395-data': 0.0.4 ember-rfc176-data: 0.3.18 eslint: 8.57.1 snake-case: 3.0.4 optionalDependencies: - '@babel/eslint-parser': 7.25.7(@babel/core@7.25.7)(eslint@8.57.1) + '@babel/eslint-parser': 7.25.8(@babel/core@7.25.8)(eslint@8.57.1) transitivePeerDependencies: - supports-color - eslint-plugin-ember@12.2.1(@babel/core@7.25.7)(eslint@8.57.1): + eslint-plugin-ember@12.2.1(@babel/core@7.25.8)(eslint@8.57.1): dependencies: '@ember-data/rfc395-data': 0.0.4 css-tree: 2.3.1 - ember-eslint-parser: 0.5.2(@babel/core@7.25.7)(eslint@8.57.1) + ember-eslint-parser: 0.5.2(@babel/core@7.25.8)(eslint@8.57.1) ember-rfc176-data: 0.3.18 eslint: 8.57.1 eslint-utils: 3.0.0(eslint@8.57.1) @@ -3032,7 +3051,7 @@ snapshots: dependencies: type-fest: 0.20.2 - globals@15.10.0: {} + globals@15.11.0: {} globalthis@1.0.4: dependencies: @@ -3463,7 +3482,7 @@ snapshots: prettier-plugin-ember-template-tag@0.3.2: dependencies: - '@babel/core': 7.25.7 + '@babel/core': 7.25.8 '@glimmer/syntax': 0.84.3 ember-cli-htmlbars: 6.3.0 ember-template-imports: 3.4.2 @@ -3783,7 +3802,7 @@ snapshots: is-typed-array: 1.1.13 possible-typed-array-names: 1.0.0 - typescript@5.6.2: {} + typescript@5.6.3: {} unbox-primitive@1.0.2: dependencies: