Skip to content

Commit

Permalink
feat:Added eslint-plugin-package-json to ESLint (#186)
Browse files Browse the repository at this point in the history
* Added package-json config to ESLint

* Added changeset files.

* Fixing CI

* Fixing downgraded dependencies

* Fixing dependency

* Fixing dependency

* Fixing CI
  • Loading branch information
patricklafrance authored Mar 11, 2024
1 parent 2cb640b commit 997054e
Show file tree
Hide file tree
Showing 17 changed files with 424 additions and 284 deletions.
5 changes: 5 additions & 0 deletions .changeset/hot-eyes-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@workleap/eslint-plugin": minor
---

Added eslint-plugin-package-json.
8 changes: 8 additions & 0 deletions .changeset/moody-ducks-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@workleap/stylelint-configs": patch
"@workleap/postcss-configs": patch
"@workleap/webpack-configs": patch
"@workleap/swc-configs": patch
---

Loosen the dependencies version.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
**/dist/*
node_modules
*.md
pnpm-lock.yaml
*.md
*.snap
*.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
import { mdxFiles, sourceFiles } from "../../utils/patterns";

import type { Linter } from "eslint";

const config: Linter.Config = {
overrides: [
{
files: sourceFiles,
plugins: ["@workleap"],
extends: [
"plugin:@workleap/core",
"plugin:@workleap/typescript",
"plugin:@workleap/jest",
"plugin:@workleap/testing-library"
]
},
{
files: mdxFiles,
plugins: ["@workleap"],
extends: ["plugin:@workleap/mdx"]
}
]
plugins: ["@workleap"],
extends: [
"plugin:@workleap/core",
"plugin:@workleap/typescript",
"plugin:@workleap/jest",
"plugin:@workleap/testing-library",
"plugin:@workleap/mdx",
"plugin:@workleap/package-json"
],
rules: {
"package-json/valid-version": "off"
}
};

// Using TypeScript "export" keyword until ESLint support ESM.
Expand Down
42 changes: 16 additions & 26 deletions packages/eslint-plugin/lib/config/by-project-type/react-library.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
import { mdxFiles, sourceFiles } from "../../utils/patterns";

import type { Linter } from "eslint";

const config: Linter.Config = {
overrides: [
{
files: sourceFiles,
plugins: ["@workleap"],
extends: [
"plugin:@workleap/core",
"plugin:@workleap/typescript",
"plugin:@workleap/react",
"plugin:@workleap/jsx-a11y",
"plugin:@workleap/jest",
"plugin:@workleap/testing-library",
"plugin:@workleap/storybook"
],
rules: {
// Custom WorkLeap rules
"@workleap/strict-css-modules-names": "warn"
}
},
{
files: mdxFiles,
plugins: ["@workleap"],
extends: ["plugin:@workleap/mdx"]
}
]
plugins: ["@workleap"],
extends: [
"plugin:@workleap/core",
"plugin:@workleap/typescript",
"plugin:@workleap/react",
"plugin:@workleap/jsx-a11y",
"plugin:@workleap/jest",
"plugin:@workleap/testing-library",
"plugin:@workleap/storybook",
"plugin:@workleap/mdx",
"plugin:@workleap/package-json"
],
rules: {
// Custom WorkLeap rules
"@workleap/strict-css-modules-names": "warn"
}
};

// Using TypeScript "export" keyword until ESLint support ESM.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
import { mdxFiles, sourceFiles } from "../../utils/patterns";

import type { Linter } from "eslint";

const config: Linter.Config = {
overrides: [
{
files: sourceFiles,
plugins: ["@workleap"],
extends: [
"plugin:@workleap/core",
"plugin:@workleap/typescript",
"plugin:@workleap/jest",
"plugin:@workleap/testing-library"
]
},
{
files: mdxFiles,
plugins: ["@workleap"],
extends: ["plugin:@workleap/mdx"]
}
plugins: ["@workleap"],
extends: [
"plugin:@workleap/core",
"plugin:@workleap/typescript",
"plugin:@workleap/jest",
"plugin:@workleap/testing-library",
"plugin:@workleap/mdx",
"plugin:@workleap/package-json"
]
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
import { mdxFiles, sourceFiles } from "../../utils/patterns";

import type { Linter } from "eslint";

const config: Linter.Config = {
overrides: [
{
files: sourceFiles,
plugins: ["@workleap"],
extends: [
"plugin:@workleap/core",
"plugin:@workleap/typescript",
"plugin:@workleap/react",
"plugin:@workleap/jsx-a11y",
"plugin:@workleap/jest",
"plugin:@workleap/testing-library",
"plugin:@workleap/storybook"
],
rules: {
// Custom WorkLeap rules
"@workleap/strict-css-modules-names": "warn"
}
},
{
files: mdxFiles,
plugins: ["@workleap"],
extends: ["plugin:@workleap/mdx"]
}
]
plugins: ["@workleap"],
extends: [
"plugin:@workleap/core",
"plugin:@workleap/typescript",
"plugin:@workleap/react",
"plugin:@workleap/jsx-a11y",
"plugin:@workleap/jest",
"plugin:@workleap/testing-library",
"plugin:@workleap/storybook",
"plugin:@workleap/mdx",
"plugin:@workleap/package-json"
],
rules: {
// Custom WorkLeap rules
"@workleap/strict-css-modules-names": "warn"
}
};

// Using TypeScript "export" keyword until ESLint support ESM.
Expand Down
Loading

0 comments on commit 997054e

Please sign in to comment.