starters
starters copied to clipboard
refactor(react): update .eslintrc.js and rename to .eslintrc.cjs
Add additional configuration for proper linting such as including @typescript-eslint/recommended plugin.
this should also address ionic-team/ionic-cli#5015
@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 },
],
},
})
Is this template used by the @ionic/cli? I am looking to refactor the eslint config for the React -> ${name} -> blank starter project.