DEV: Update linting setup (#69)

This commit is contained in:
Jarek Radosz 2023-11-19 22:43:47 +01:00 committed by GitHub
parent a807ff3546
commit bab2e8f3b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 1049 additions and 846 deletions

View File

@ -1,8 +0,0 @@
{
"extends": "eslint-config-discourse",
"ignorePatterns": ["javascripts/vendor/*"],
"globals": {
"settings": "readonly",
"themePrefix": "readonly"
}
}

1
.eslintrc.cjs Normal file
View File

@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/eslint-theme");

View File

@ -1 +0,0 @@
{}

1
.prettierrc.cjs Normal file
View File

@ -0,0 +1 @@
module.exports = require("@discourse/lint-configs/prettier");

View File

@ -1,4 +1 @@
module.exports = { module.exports = require("@discourse/lint-configs/template-lint");
plugins: ["ember-template-lint-plugin-discourse"],
extends: "discourse:recommended",
};

View File

@ -1,5 +1,5 @@
import I18n from "I18n";
import { withPluginApi } from "discourse/lib/plugin-api"; import { withPluginApi } from "discourse/lib/plugin-api";
import I18n from "I18n";
export default { export default {
name: "disco-toc-composer", name: "disco-toc-composer",

View File

@ -1,9 +1,9 @@
import domUtils from "discourse-common/utils/dom-utils";
import { headerOffset } from "discourse/lib/offset-calculator";
import { iconHTML } from "discourse-common/lib/icon-library";
import { later } from "@ember/runloop"; import { later } from "@ember/runloop";
import { slugify } from "discourse/lib/utilities"; import { headerOffset } from "discourse/lib/offset-calculator";
import { withPluginApi } from "discourse/lib/plugin-api"; import { withPluginApi } from "discourse/lib/plugin-api";
import { slugify } from "discourse/lib/utilities";
import { iconHTML } from "discourse-common/lib/icon-library";
import domUtils from "discourse-common/utils/dom-utils";
import I18n from "I18n"; import I18n from "I18n";
export default { export default {

View File

@ -5,6 +5,9 @@
"author": "Discourse", "author": "Discourse",
"license": "MIT", "license": "MIT",
"devDependencies": { "devDependencies": {
"eslint-config-discourse": "^3.2.0" "@discourse/lint-configs": "^1.0.0",
"ember-template-lint": "^5.12.0",
"eslint": "^8.53.0",
"prettier": "^2.8.8"
} }
} }

View File

@ -1,12 +1,12 @@
import I18n from "discourse-i18n"; import { click, visit } from "@ember/test-helpers";
import { test } from "qunit";
import { import {
acceptance, acceptance,
exists, exists,
query, query,
} from "discourse/tests/helpers/qunit-helpers"; } from "discourse/tests/helpers/qunit-helpers";
import { click, visit } from "@ember/test-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper"; import selectKit from "discourse/tests/helpers/select-kit-helper";
import { test } from "qunit"; import I18n from "discourse-i18n";
acceptance("DiscoTOC - Composer", function (needs) { acceptance("DiscoTOC - Composer", function (needs) {
needs.user(); needs.user();

View File

@ -1,11 +1,11 @@
import { visit } from "@ember/test-helpers";
import { test } from "qunit";
import topicFixtures from "discourse/tests/fixtures/topic";
import { import {
acceptance, acceptance,
exists, exists,
query, query,
} from "discourse/tests/helpers/qunit-helpers"; } from "discourse/tests/helpers/qunit-helpers";
import { visit } from "@ember/test-helpers";
import { test } from "qunit";
import topicFixtures from "discourse/tests/fixtures/topic";
import { cloneJSON } from "discourse-common/lib/object"; import { cloneJSON } from "discourse-common/lib/object";
const COOKED_WITH_HEADINGS = const COOKED_WITH_HEADINGS =

1852
yarn.lock

File diff suppressed because it is too large Load Diff