Skip to content

Commit

Permalink
Migrate eslint configs
Browse files Browse the repository at this point in the history
  • Loading branch information
darthmaim committed Dec 6, 2024
1 parent d28d062 commit 2870b98
Show file tree
Hide file tree
Showing 24 changed files with 230 additions and 390 deletions.
5 changes: 0 additions & 5 deletions apps/legacy-importer/.eslintrc.json

This file was deleted.

13 changes: 13 additions & 0 deletions apps/legacy-importer/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default [...compat.extends('@gw2treasures/eslint-config')];
2 changes: 2 additions & 0 deletions apps/legacy-importer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"gw2-api-types": "0.0.8"
},
"devDependencies": {
"@eslint/eslintrc": "3.2.0",
"@eslint/js": "9.16.0",
"@gw2treasures/eslint-config": "workspace:*",
"@gw2treasures/tsconfig": "workspace:*",
"@types/node": "22.10.1",
Expand Down
19 changes: 0 additions & 19 deletions apps/web/.eslintrc.json

This file was deleted.

32 changes: 32 additions & 0 deletions apps/web/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import nextJsPlugin from '@gw2treasures/eslint-plugin-nextjs';
import reactCompiler from 'eslint-plugin-react-compiler';
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import { FlatCompat } from '@eslint/eslintrc';

const compat = new FlatCompat({
baseDirectory: import.meta.url,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default tseslint.config(
{ ignores: ['.next'] },
...compat.extends('next/core-web-vitals', '@gw2treasures/eslint-config/react'),
{
plugins: {
'@gw2treasures/nextjs': nextJsPlugin,
'react-compiler': reactCompiler,
},
},
{
files: ['**/page.tsx'],
rules: {
'@gw2treasures/nextjs/require-metadata': 'warn',
},
}, {
files: ['eslint.config.mjs'],
// eslint-disable-next-line import/no-named-as-default-member
extends: [tseslint.configs.disableTypeChecked],
}
);
5 changes: 4 additions & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"sharp": "0.33.5"
},
"devDependencies": {
"@eslint/eslintrc": "3.2.0",
"@eslint/js": "9.16.0",
"@gw2api/types": "0.0.22",
"@gw2treasures/eslint-config": "workspace:*",
"@gw2treasures/eslint-plugin-nextjs": "workspace:*",
Expand All @@ -77,6 +79,7 @@
"jest-environment-jsdom": "29.7.0",
"ts-node": "10.9.2",
"tslib": "2.8.1",
"typescript": "5.7.2"
"typescript": "5.7.2",
"typescript-eslint": "8.17.0"
}
}
5 changes: 0 additions & 5 deletions apps/worker/.eslintrc.json

This file was deleted.

13 changes: 13 additions & 0 deletions apps/worker/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default [...compat.extends('@gw2treasures/eslint-config')];
2 changes: 2 additions & 0 deletions apps/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"sharp": "0.33.5"
},
"devDependencies": {
"@eslint/eslintrc": "3.2.0",
"@eslint/js": "9.16.0",
"@gw2api/types": "0.0.22",
"@gw2treasures/eslint-config": "workspace:*",
"@gw2treasures/tsconfig": "workspace:*",
Expand Down
7 changes: 6 additions & 1 deletion packages/eslint-config/configs/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,10 @@
{ "selector": "default", "format": null },
{ "selector": "typeLike", "format": ["PascalCase"] }
]
}
},

"overrides": [{
"files": ["**/eslint.config.mjs"],
"extends": "plugin:@typescript-eslint/disable-type-checked"
}]
}
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"eslint-plugin-react": "7.37.2"
},
"peerDependencies": {
"eslint": "^8.57.0"
"eslint": "^9.16.0"
},
"publishConfig": {
"access": "public"
Expand Down
7 changes: 0 additions & 7 deletions packages/eslint-plugin-nextjs/.eslintrc.json

This file was deleted.

17 changes: 17 additions & 0 deletions packages/eslint-plugin-nextjs/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [
{ ignores: ['dist/**/*'] },
...compat.extends('@gw2treasures/eslint-config')
];
2 changes: 2 additions & 0 deletions packages/eslint-plugin-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
"@typescript-eslint/utils": "8.17.0"
},
"devDependencies": {
"@eslint/eslintrc": "3.2.0",
"@eslint/js": "9.16.0",
"@gw2treasures/eslint-config": "workspace:*",
"@gw2treasures/tsconfig": "workspace:*",
"eslint": "9.16.0",
Expand Down
5 changes: 0 additions & 5 deletions packages/helper/.eslintrc.json

This file was deleted.

13 changes: 13 additions & 0 deletions packages/helper/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});
export default [...compat.extends('@gw2treasures/eslint-config')];
2 changes: 2 additions & 0 deletions packages/helper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
},
"homepage": "https://github.com/GW2Treasures/gw2treasures.com#readme",
"devDependencies": {
"@eslint/eslintrc": "3.2.0",
"@eslint/js": "9.16.0",
"@gw2treasures/eslint-config": "workspace:*",
"@gw2treasures/tsconfig": "workspace:*",
"eslint": "9.16.0",
Expand Down
9 changes: 0 additions & 9 deletions packages/publish-package/.eslintrc.json

This file was deleted.

17 changes: 17 additions & 0 deletions packages/publish-package/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [
{ ignores: ['**/bin/'] },
...compat.extends('@gw2treasures/eslint-config')
];
2 changes: 2 additions & 0 deletions packages/publish-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
},
"homepage": "https://github.com/GW2Treasures/gw2treasures.com#readme",
"devDependencies": {
"@eslint/eslintrc": "3.2.0",
"@eslint/js": "9.16.0",
"@gw2treasures/eslint-config": "workspace:*",
"@gw2treasures/tsconfig": "workspace:*",
"@types/node": "22.10.1",
Expand Down
13 changes: 0 additions & 13 deletions packages/ui/.eslintrc.json

This file was deleted.

20 changes: 20 additions & 0 deletions packages/ui/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

const eslintConfig = [
{ ignores: ['components/Table/comparable-properties.ts'] },
...compat.extends('next/core-web-vitals', '@gw2treasures/eslint-config/react'),
{ rules: { '@next/next/no-html-link-for-pages': 'off' }}
];

export default eslintConfig;
2 changes: 2 additions & 0 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
"server-only": "0.0.1"
},
"devDependencies": {
"@eslint/eslintrc": "3.2.0",
"@eslint/js": "9.16.0",
"@gw2treasures/eslint-config": "workspace:*",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.1",
Expand Down
Loading

0 comments on commit 2870b98

Please sign in to comment.