Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: anolilab/javascript-style-guide
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @anolilab/eslint-config@6.1.7
Choose a base ref
...
head repository: anolilab/javascript-style-guide
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @anolilab/eslint-config@6.1.8
Choose a head ref
  • 3 commits
  • 5 files changed
  • 2 contributors

Commits on Jun 22, 2023

  1. fix: fixed wrong import, added better plugin login for testing-library

    Signed-off-by: prisis <d.bannert@anolilab.de>
    prisis committed Jun 22, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    rueian Rueian
    Copy the full SHA
    857d734 View commit details
  2. style: cs fixes

    Signed-off-by: prisis <d.bannert@anolilab.de>
    prisis committed Jun 22, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    rueian Rueian
    Copy the full SHA
    3597eba View commit details
  3. chore(release): @anolilab/eslint-config@6.1.8 [skip ci]\n\n## @anolil…

    …ab/eslint-config [6.1.8](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@6.1.7...@anolilab/eslint-config@6.1.8) (2023-06-22)
    
    ### Bug Fixes
    
    * fixed wrong import, added better plugin login for testing-library ([857d734](857d734))
    github-actions[bot] committed Jun 22, 2023

    Verified

    This commit was signed with the committer’s verified signature.
    rueian Rueian
    Copy the full SHA
    8418946 View commit details
7 changes: 7 additions & 0 deletions packages/eslint-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## @anolilab/eslint-config [6.1.8](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@6.1.7...@anolilab/eslint-config@6.1.8) (2023-06-22)


### Bug Fixes

* fixed wrong import, added better plugin login for testing-library ([857d734](https://github.com/anolilab/javascript-style-guide/commit/857d734cead4f1551bc466888d854a9ab6ab0a4a))

## @anolilab/eslint-config [6.1.7](https://github.com/anolilab/javascript-style-guide/compare/@anolilab/eslint-config@6.1.6...@anolilab/eslint-config@6.1.7) (2023-06-22)


2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@anolilab/eslint-config",
"version": "6.1.7",
"version": "6.1.8",
"description": "ESLint shareable config for the Anolilab JavaScript style guide.",
"keywords": [
"anolilab",
4 changes: 4 additions & 0 deletions packages/eslint-config/src/config.ts
Original file line number Diff line number Diff line change
@@ -119,6 +119,10 @@ const pluginConfig: PackageRules = [
configName: "testing-library",
dependencies: ["@testing-library/dom", "eslint-plugin-testing-library"],
},
{
configName: "testing-library",
dependencies: ["react", "@testing-library/react", "eslint-plugin-testing-library"],
},
{
configName: "typescript",
dependencies: ["typescript"],
5 changes: 1 addition & 4 deletions packages/eslint-config/src/config/plugins/react.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @see https://github.com/yannickcr/eslint-plugin-react
import { hasAnyDep, pkg } from "@anolilab/package-json-utils";
import { getPackageSubProperty } from "@anolilab/package-json-utils/src";
import { getPackageSubProperty,hasAnyDep, pkg } from "@anolilab/package-json-utils";
import type { Linter } from "eslint";
import findUp from "find-up";
import { env } from "node:process";
@@ -68,11 +67,9 @@ const hasJsxRuntime = (() => {
return global.hasAnolilabEsLintConfigReactRuntimePath;
})();

// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
let reactVersion: string | undefined = getPackageSubProperty<string>("dependencies")("react")

if (reactVersion === undefined) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call
reactVersion = getPackageSubProperty<string | undefined>("devDependencies")("react");
}

12 changes: 6 additions & 6 deletions packages/eslint-config/src/config/plugins/testing-library.ts
Original file line number Diff line number Diff line change
@@ -3,19 +3,19 @@ import type { Linter } from "eslint";

import { consolePlugin } from "../../utils/loggers";

let ruleset = "dom";

if (hasAnyDep(["react"])) {
ruleset = "react";
}

let anolilabEslintConfig: { [key: string]: boolean | undefined } = {};

if (pkg) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-member-access
anolilabEslintConfig = pkg?.["anolilab"]?.["eslint-config"];
}

let ruleset = "dom";

if (hasAnyDep(["react", "@testing-library/react"])) {
ruleset = "react";
}

// Workaround VS Code trying to run this file twice!
if (!global.hasAnolilabEsLintTestConfigLoaded) {
if (anolilabEslintConfig?.["info_on_testing_library_framework"] !== false) {