Skip to content

Commit

Permalink
DEV: Update linting
Browse files Browse the repository at this point in the history
  • Loading branch information
CvX committed Jan 16, 2024
1 parent 2ec29a0 commit 03bae64
Show file tree
Hide file tree
Showing 20 changed files with 1,207 additions and 678 deletions.
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/eslint");
1 change: 0 additions & 1 deletion .prettierrc

This file was deleted.

1 change: 1 addition & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/prettier");
1 change: 1 addition & 0 deletions .template-lintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/template-lint");
4 changes: 0 additions & 4 deletions .template-lintrc.js

This file was deleted.

33 changes: 15 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@ GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
json (2.6.3)
json (2.7.1)
language_server-protocol (3.17.0.3)
parallel (1.23.0)
parser (3.2.2.4)
parallel (1.24.0)
parser (3.3.0.4)
ast (~> 2.4.1)
racc
prettier_print (1.2.1)
racc (1.7.3)
rainbow (3.1.1)
regexp_parser (2.8.2)
regexp_parser (2.9.0)
rexml (3.2.6)
rubocop (1.57.2)
rubocop (1.60.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.19.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-discourse (3.4.1)
rubocop (>= 1.1.0)
rubocop-rspec (>= 2.0.0)
rubocop-factory_bot (2.24.0)
rubocop (~> 1.33)
rubocop-rspec (2.25.0)
rubocop-discourse (3.6.0)
rubocop (>= 1.59.0)
rubocop-rspec (>= 2.25.0)
rubocop-factory_bot (2.25.1)
rubocop (~> 1.41)
rubocop-rspec (2.26.1)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
Expand All @@ -43,14 +43,11 @@ GEM
unicode-display_width (2.5.0)

PLATFORMS
arm64-darwin-20
arm64-darwin-22
ruby
x86_64-linux

DEPENDENCIES
rubocop-discourse
syntax_tree

BUNDLED WITH
2.1.4
2.5.4
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import I18n from "I18n";
import { withPluginApi } from "discourse/lib/plugin-api";
import NavItem from "discourse/models/nav-item";
import I18n from "I18n";

export default {
name: "discourse-topic-voting",

initialize() {
withPluginApi("0.8.32", (api) => {
const siteSettings = api.container.lookup("site-settings:main");
const siteSettings = api.container.lookup("service:site-settings");
if (siteSettings.voting_enabled) {
const pageSearchController = api.container.lookup(
"controller:full-page-search"
Expand Down Expand Up @@ -60,7 +60,7 @@ export default {
});

withPluginApi("0.11.7", (api) => {
const siteSettings = api.container.lookup("site-settings:main");
const siteSettings = api.container.lookup("service:site-settings");
if (siteSettings.voting_enabled) {
api.addSearchSuggestion("order:votes");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import I18n from "I18n";
import { withPluginApi } from "discourse/lib/plugin-api";
import I18n from "I18n";

function initialize(api) {
api.addPostClassesCallback((post) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import UserTopicListRoute from "discourse/routes/user-topic-list";
import UserAction from "discourse/models/user-action";
import UserTopicListRoute from "discourse/routes/user-topic-list";
import I18n from "I18n";

export default UserTopicListRoute.extend({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import I18n from "I18n";
import { createWidget } from "discourse/widgets/widget";
import { iconNode } from "discourse-common/lib/icon-library";
import I18n from "I18n";

export default createWidget("remove-vote", {
tagName: "div.remove-vote",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import I18n from "I18n";
import { createWidget } from "discourse/widgets/widget";
import { ajax } from "discourse/lib/ajax";
import RawHtml from "discourse/widgets/raw-html";
import { popupAjaxError } from "discourse/lib/ajax-error";
import RawHtml from "discourse/widgets/raw-html";
import { createWidget } from "discourse/widgets/widget";
import I18n from "I18n";

export default createWidget("vote-box", {
tagName: "div.voting-wrapper",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import I18n from "I18n";
import { createWidget } from "discourse/widgets/widget";
import $ from "jquery";
import { h } from "virtual-dom";
import { createWidget } from "discourse/widgets/widget";
import I18n from "I18n";

export default createWidget("vote-button", {
tagName: "div",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { createWidget } from "discourse/widgets/widget";
import getURL from "discourse-common/lib/get-url";
import $ from "jquery";
import { h } from "virtual-dom";
import { ajax } from "discourse/lib/ajax";
import { createWidget } from "discourse/widgets/widget";
import getURL from "discourse-common/lib/get-url";

export default createWidget("vote-count", {
tagName: "div.vote-count-wrapper",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import I18n from "I18n";
import { createWidget } from "discourse/widgets/widget";
import { h } from "virtual-dom";
import { createWidget } from "discourse/widgets/widget";
import I18n from "I18n";

export default createWidget("vote-options", {
tagName: "div.vote-options",
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "discourse-topic-voting",
"version": "1.0.0",
"repository": "git@github.com:discourse/discourse-topic-voting.git",
"author": "Discourse",
"license": "MIT",
"private": true,
"devDependencies": {
"eslint-config-discourse": "^3.4.0"
"@discourse/lint-configs": "^1.3.5",
"ember-template-lint": "^5.13.0",
"eslint": "^8.56.0",
"prettier": "^2.8.8"
}
}
4 changes: 2 additions & 2 deletions spec/voting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
before { user0.votes.delete_all }

it "returns a vote count of zero" do
expect(user0.vote_count).to eq (0)
expect(user0.topics_with_archived_vote.pluck(:topic_id)).to eq ([])
expect(user0.vote_count).to eq(0)
expect(user0.topics_with_archived_vote.pluck(:topic_id)).to eq([])
end
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit";
import { visit } from "@ember/test-helpers";
import { test } from "qunit";
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
import I18n from "I18n";

acceptance(
Expand Down
Loading

0 comments on commit 03bae64

Please sign in to comment.