Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: update ESLint to v9 #766

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .eslintignore

This file was deleted.

115 changes: 0 additions & 115 deletions .eslintrc.js.json

This file was deleted.

93 changes: 0 additions & 93 deletions .eslintrc.json

This file was deleted.

8 changes: 0 additions & 8 deletions .eslintrc.react.json

This file was deleted.

103 changes: 103 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
import eslintConfigPrettier from 'eslint-config-prettier';
import eslintPluginImport from 'eslint-plugin-import';
import eslintPluginReact from 'eslint-plugin-react';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import { jsRules, reactRules } from './eslint.rules.mjs';

export default tseslint.config(
{
name: 'nlds/ignores',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We doen steeds erg ons best om niet nlds te gebruiken. Kunnen we ook hier nlds vermijden?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja, ik haal het nog helemaal weg omdat het alleen voor te debuggen is.

ignores: [
'**/build/',
'**/coverage/',
'**/dist/',
'**/tmp/',
// for @stencil/react-output-target >=0.6
'packages/web-components-react/src/stencil-generated',
// for @stencil/react-output-target <0.6
'packages/web-components-react/src/react-component-lib/',
'packages/web-components-react/src/components.ts',
'packages/web-components-stencil/{loader,www}',
],
},
{
name: 'nlds/settings',
// https://eslint.org/docs/latest/use/configure/configuration-files#configuring-linter-options
linterOptions: {
reportUnusedDisableDirectives: true,
},
// https://eslint.org/docs/latest/use/configure/configuration-files#configuring-shared-settings
settings: {
react: {
version: 'detect',
},
},
languageOptions: {
parserOptions: {
sourceType: 'module',
},
},
},
{
name: 'nlds/rules',
plugins: {
import: eslintPluginImport,
},
rules: jsRules,
},
...tseslint.configs.recommended,
{
name: 'nlds/tooling',
files: ['**/*.cjs', '**/vite.config.ts'],
languageOptions: {
globals: { ...globals.node },
},
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
{
name: 'nlds/test-files',
files: ['**/*.test.{ts,tsx,js,jsx}'],
languageOptions: {
globals: { ...globals.jest },
},
},
{
name: 'nlds/source-code',
files: ['**/src/*.{js,mjs,ts}'],
languageOptions: {
globals: { ...globals.browser },
},
},
{
name: 'nlds/react-jsx',
files: ['**/*.{jsx,tsx}'],
ignores: ['**/web-components-stencil/**/*.{jsx,tsx}'],
plugins: {
react: eslintPluginReact,
},
rules: {
...eslintPluginReact.configs.recommended.rules,
...eslintPluginReact.configs['jsx-runtime'].rules,
...reactRules,
},
},
{
name: 'nlds/stencil-jsx',
files: ['**/web-components-stencil/**/*.{jsx,tsx}'],
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
varsIgnorePattern: '^h$',
},
],
},
},
{
name: 'eslint-config-prettier',
...eslintConfigPrettier,
},
);
Loading