Skip to content

Commit

Permalink
chore(dev-deps): update eslint bases
Browse files Browse the repository at this point in the history
  • Loading branch information
belgattitude committed Oct 20, 2024
1 parent ba6b3e6 commit 9935c62
Show file tree
Hide file tree
Showing 32 changed files with 1,782 additions and 500 deletions.
3 changes: 0 additions & 3 deletions .ncurc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ reject:
[
'eslint',
'eslint-plugin-react-hooks',
'eslint-plugin-sonarjs',
'@pothos/plugin-prisma',
'@pothos/core',
'@pothos/plugin-errors',
'@typescript-eslint/parser',
'@typescript-eslint/eslint-plugin',
]
2 changes: 1 addition & 1 deletion apps/nextjs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"graphql": "16.9.0",
"graphql-jit": "0.8.6",
"graphql-yoga": "5.7.0",
"i18next": "23.16.0",
"i18next": "23.16.2",
"jose": "5.9.4",
"ky": "1.7.2",
"next": "14.2.15",
Expand Down
2 changes: 1 addition & 1 deletion apps/vite-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@babel/core": "7.25.8",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.1",
"@vitejs/plugin-react": "4.3.2",
"@vitejs/plugin-react": "4.3.3",
"@vitest/coverage-v8": "2.1.3",
"@vitest/ui": "2.1.3",
"@your-org/eslint-config-bases": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"rimraf": "6.0.1",
"shell-quote": "1.8.1",
"syncpack": "13.0.0",
"turbo": "2.2.0",
"turbo": "2.2.1",
"typescript": "5.6.3"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion packages/core-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@types/node": "22.7.7",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.1",
"@vitejs/plugin-react": "4.3.2",
"@vitejs/plugin-react": "4.3.3",
"@vitest/coverage-v8": "2.1.3",
"@vitest/ui": "2.1.3",
"@your-org/eslint-config-bases": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-bases/.escheckrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ecmaVersion": "es2022",
"ecmaVersion": "es2020",
"module": false,
"files": "./src/**/*.js"
}
23 changes: 16 additions & 7 deletions packages/eslint-config-bases/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
const { getDefaultIgnorePatterns } = require('./src/helpers');

module.exports = {
root: true,
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: 'tsconfig.json',
},
ignorePatterns: [...getDefaultIgnorePatterns()],
extends: [
'./src/bases/typescript',
'./src/bases/simple-import-sort',
'./src/bases/import-x',
'./src/bases/sonar',
'./src/bases/regexp',
'./src/bases/perfectionist',
'./src/bases/performance',
'./src/bases/prettier-plugin',
'./src/bases/mdx',
],
ignorePatterns: [...getDefaultIgnorePatterns()],
parser: '@typescript-eslint/parser',
parserOptions: {
projectService: true,
tsconfigRootDir: __dirname,
},
root: true,
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
};
14 changes: 14 additions & 0 deletions packages/eslint-config-bases/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// @ts-check
const {
getPrettierConfig,
} = require("./src/helpers");

/**
* @type {import('prettier').Config}
*/
module.exports = {
...getPrettierConfig(),
overrides: [
// whatever you need
],
};
79 changes: 61 additions & 18 deletions packages/eslint-config-bases/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
{
"name": "@your-org/eslint-config-bases",
"version": "1.5.4",
"version": "6.0.2",
"license": "MIT",
"private": true,
"homepage": "https://github.com/belgattitude/nextjs-monorepo-example/tree/main/packages/eslint-config-bases",
"repository": {
"type": "git",
"url": "https://github.com/belgattitude/nextjs-monorepo-example",
"directory": "packages/eslint-config-bases"
},
"author": {
"name": "Vanvelthem Sébastien",
"url": "https://github.com/belgattitude"
},
"keywords": [
"eslint",
"eslint-config"
],
"type": "commonjs",
"main": "./src/index.js",
"exports": {
Expand All @@ -20,9 +35,18 @@
"./mdx": {
"require": "./src/bases/mdx.js"
},
"./import-x": {
"require": "./src/bases/import-x.js"
},
"./jest": {
"require": "./src/bases/jest.js"
},
"./perfectionist": {
"require": "./src/bases/perfectionist.js"
},
"./perfectionist-jsx": {
"require": "./src/bases/perfectionist-jsx.js"
},
"./playwright": {
"require": "./src/bases/playwright.js"
},
Expand All @@ -32,6 +56,9 @@
"./prettier-plugin": {
"require": "./src/bases/prettier-plugin.js"
},
"./performance": {
"require": "./src/bases/performance.js"
},
"./react": {
"require": "./src/bases/react.js"
},
Expand All @@ -44,6 +71,9 @@
"./regexp": {
"require": "./src/bases/regexp.js"
},
"./simple-import-sort": {
"require": "./src/bases/simple-import-sort.js"
},
"./sonar": {
"require": "./src/bases/sonar.js"
},
Expand All @@ -67,38 +97,48 @@
"dependencies": {
"@rushstack/eslint-patch": "^1.10.4",
"@tanstack/eslint-plugin-query": "^5.59.7",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"@typescript-eslint/eslint-plugin": "^8.10.0",
"@typescript-eslint/parser": "^8.10.0",
"@typescript-eslint/typescript-estree": "^8.10.0",
"@typescript-eslint/utils": "^8.10.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-import-x": "^4.3.1",
"eslint-plugin-jest": "^28.8.3",
"eslint-plugin-jest-formatting": "^3.1.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-playwright": "^1.7.0",
"eslint-plugin-perfectionist": "^3.9.1",
"eslint-plugin-playwright": "^1.8.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-react": "^7.37.1",
"eslint-plugin-react-hooks": "^4.6.2 || 5.0.0-canary-7118f5dd7-20230705",
"eslint-plugin-react-hooks": "^4.6.2 || ^5.0.0 || 5.0.0-canary-7118f5dd7-20230705",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-sonarjs": "^0.25.1",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-sonarjs": "^2.0.4",
"eslint-plugin-storybook": "^0.9.0",
"eslint-plugin-testing-library": "^6.4.0"
"eslint-plugin-testing-library": "^6.4.0",
"eslint-plugin-unicorn": "^56.0.0",
"eslint-plugin-unused-imports": "^4.1.4"
},
"peerDependencies": {
"@graphql-eslint/eslint-plugin": "^3.14.3",
"eslint": "^8.55.0",
"eslint-plugin-mdx": "^2.2.0 || ^3.0.0",
"eslint-plugin-tailwindcss": "^3.13.0",
"graphql": "^16.8.0",
"prettier": "^3.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.1.6"
"@graphql-eslint/eslint-plugin": "^3.20.1",
"@testing-library/dom": "^10.4.0",
"eslint": "^8.57.1",
"eslint-plugin-mdx": "^3.1.5",
"eslint-plugin-tailwindcss": "^3.17.4",
"graphql": "^16.9.0",
"prettier": ">=3.2.0 <5.0.0",
"react": ">=18.2.0",
"react-dom": ">=18.2.0",
"typescript": "^5.3.1"
},
"peerDependenciesMeta": {
"@graphql-eslint/eslint-plugin": {
"optional": true
},
"@testing-library/dom": {
"optional": true
},
"eslint-plugin-mdx": {
"optional": true
},
Expand Down Expand Up @@ -127,7 +167,9 @@
"devDependencies": {
"@graphql-eslint/eslint-plugin": "3.20.1",
"@testing-library/dom": "10.4.0",
"@testing-library/jest-dom": "6.6.2",
"@testing-library/react": "16.0.1",
"@types/jest": "29.5.13",
"@types/node": "22.7.7",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.1",
Expand All @@ -136,13 +178,14 @@
"eslint-plugin-mdx": "3.1.5",
"eslint-plugin-tailwindcss": "3.17.5",
"graphql": "16.9.0",
"prettier": "3.3.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"rimraf": "6.0.1",
"tailwindcss": "3.4.14",
"typescript": "5.6.3"
},
"engines": {
"node": ">=18.12.0"
"node": ">=18.18.0"
}
}
4 changes: 2 additions & 2 deletions packages/eslint-config-bases/src/bases/graphql-schema.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Opinionated config base for projects using graphql schemas (*.graphql)
* @see https://github.com/belgattitude/nextjs-monorepo-example/tree/main/packages/eslint-config-bases
* @see https://github.com/belgattitude/shared-dx/tree/main/packages/eslint-config-bases
*/
const graphqlSchemaPatterns = {
files: ['*.graphql'],
Expand All @@ -9,9 +9,9 @@ const graphqlSchemaPatterns = {
module.exports = {
overrides: [
{
files: graphqlSchemaPatterns.files,
// @see https://github.com/B2o5T/graphql-eslint
extends: 'plugin:@graphql-eslint/schema-recommended',
files: graphqlSchemaPatterns.files,
rules: {
'@graphql-eslint/known-type-names': 'error',
},
Expand Down
28 changes: 28 additions & 0 deletions packages/eslint-config-bases/src/bases/import-x.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Custom config base for projects using jest.
* @see https://github.com/belgattitude/shared-dx/tree/main/packages/eslint-config-bases
*/
const { filePatterns } = require('../config/file-patterns');

module.exports = {
extends: ['plugin:import-x/typescript', 'plugin:import-x/recommended'],
rules: {
'import-x/no-unused-modules': 'warn',
'import-x/no-absolute-path': 'error',
'import-x/no-useless-path-segments': 'error',
},
overrides: [
{
files: filePatterns.test,
rules: {
'import-x/namespace': 'off',
},
},
],
settings: {
'import-x/resolver': {
typescript: true,
node: true,
},
},
};
11 changes: 8 additions & 3 deletions packages/eslint-config-bases/src/bases/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
module.exports = {
graphqlSchema: require('./graphql-schema'),
'import-x': require('./import-x'),
jest: require('./jest'),
mdx: require('./mdx'),
perfectionist: require('./perfectionist'),
'perfectionist-jsx': require('./perfectionist-jsx'),
playwright: require('./playwright'),
'prettier-plugin': require('./prettier-plugin'),
'prettier-config': require('./prettier-config'),
'prettier-plugin': require('./prettier-plugin'),
performance: require('./performance'),
react: require('./react'),
regexp: require('./regexp'),
reactQuery: require('./react-query'),
reactTestingLibrary: require('./rtl'),
storybook: require('./storybook'),
regexp: require('./regexp'),
'simple-import-sort': require('./simple-import-sort'),
sonar: require('./sonar'),
storybook: require('./storybook'),
tailwind: require('./tailwind'),
typescript: require('./typescript'),
};
Loading

0 comments on commit 9935c62

Please sign in to comment.