@woshapp/lint-config
v0.1.4
Published
Shared lint and format config for Zivi JavaScript and TypeScript projects
Readme
@woshapp/lint-config
Shared oxlint and oxfmt configuration for Zivi JavaScript and TypeScript projects.
Install
npm install --save-dev @woshapp/lint-config oxlint oxlint-tsgolint oxfmtInstall the fallback ESLint plugins used by the preset you choose:
npm install --save-dev eslint-plugin-communist-spellingFor Node projects:
npm install --save-dev eslint-plugin-nFor React projects:
npm install --save-dev eslint-plugin-decorator-position eslint-plugin-react-hooks eslint-plugin-mobxFor React Native projects:
npm install --save-dev eslint-plugin-import eslint-plugin-react-native eslint-plugin-unused-importsOxlint
Use oxlint.config.ts so the shared package can be imported directly.
Base config:
import { defineConfig } from 'oxlint'
import config from '@woshapp/lint-config'
export default defineConfig(config)Node:
import { defineConfig } from 'oxlint'
import config from '@woshapp/lint-config/node'
export default defineConfig(config)React:
import { defineConfig } from 'oxlint'
import config from '@woshapp/lint-config/react'
export default defineConfig(config)React Native:
import { defineConfig } from 'oxlint'
import config from '@woshapp/lint-config/react-native'
export default defineConfig({
...config,
ignorePatterns: [
...(config.ignorePatterns ?? []),
'.yarn/**',
'android/**',
'ios/**',
'node_modules/**',
],
})Recommended scripts:
{
"scripts": {
"lint": "oxlint -c oxlint.config.ts .",
"lint:fix": "oxlint -c oxlint.config.ts --fix .",
"format": "oxfmt -c oxfmt.config.ts --write .",
"format:check": "oxfmt -c oxfmt.config.ts --check ."
}
}Oxfmt
Use oxfmt.config.ts so the shared formatter options can be imported directly.
import { defineConfig } from 'oxfmt'
import config from '@woshapp/lint-config/oxfmt'
export default defineConfig(config)The package also includes @woshapp/lint-config/oxfmt.json as a copyable reference for projects that prefer JSON config.
Notes
This package uses oxlint native rules first. A few legacy rules are provided through oxlint JS plugins while the projects migrate away from ESLint.
