Skip to content

Commit

Permalink
Added package-json config to ESLint
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklafrance committed Mar 11, 2024
1 parent 2cb640b commit db8476f
Show file tree
Hide file tree
Showing 16 changed files with 414 additions and 287 deletions.
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@
"devDependencies": {
"@changesets/changelog-github": "0.5.0",
"@changesets/cli": "2.27.1",
"@typescript-eslint/parser": "7.1.1",
"@typescript-eslint/parser": "7.0.1",
"@workleap/eslint-plugin": "workspace:*",
"@workleap/typescript-configs": "workspace:*",
"eslint": "8.57.0",
"eslint": "8.56.0",
"jest": "29.7.0",
"prettier": "3.2.5",
"retypeapp": "3.5.0",
"stylelint": "16.2.1",
"ts-node": "10.9.2",
"typescript": "5.4.2"
"typescript": "5.3.3"
},
"engines": {
"node": ">=16.0.0"
Expand Down
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 db8476f

Please sign in to comment.