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

refactor(react): update .eslintrc.js and rename to .eslintrc.cjs #1854

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aretrace
Copy link

@aretrace aretrace commented Aug 8, 2024

Add additional configuration for proper linting such as including @typescript-eslint/recommended plugin.

Add additional configuration for proper linting such as  
including @typescript-eslint/recommended plugin.
@aretrace aretrace requested a review from a team as a code owner August 8, 2024 04:41
@aretrace aretrace requested review from brandyscarney and removed request for a team August 8, 2024 04:41
@aretrace
Copy link
Author

aretrace commented Aug 8, 2024

this should also address ionic-team/ionic-cli#5015

@sean-perkins
Copy link
Contributor

@aretrace the starter templates are based around the Vite default templates created from the Vite CLI.

Would you be interested in updating your PR to using valid ESM instead of renaming the file to cjs?

e.g.:

import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config({
  extends: [js.configs.recommended, ...tseslint.configs.recommended],
  files: ['**/*.{ts,tsx}'],
  ignores: ['dist'],
  languageOptions: {
    ecmaVersion: 2020,
    globals: globals.browser,
  },
  plugins: {
    'react-hooks': reactHooks,
    'react-refresh': reactRefresh,
  },
  rules: {
    ...reactHooks.configs.recommended.rules,
    'react-refresh/only-export-components': [
      'warn',
      { allowConstantExport: true },
    ],
  },
})

@aretrace
Copy link
Author

Is this template used by the @ionic/cli? I am looking to refactor the eslint config for the React -> ${name} -> blank starter project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants