This plugin supports eslint 9 only.
npm install --save --save-dev [email protected] @oursky/eslint-plugin
The following examples are the contents of your eslint.config.mjs
.
import oursky from "@oursky/eslint-plugin";
const js = "src/**/*.{js,jsx,mjs,mjsx}";
const ts = "src/**/*.{ts,tsx,mts,mtsx}";
export default [
{
files: [ts],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: [js, ts],
...oursky.configs.eslint,
},
{
files: [ts],
...oursky.configs.typescript,
},
{
files: [ts],
...oursky.configs.tsdoc,
},
{
files: [js, ts],
...oursky.configs.oursky,
},
];
import oursky from "@oursky/eslint-plugin";
const js = "src/**/*.{js,jsx,mjs,mjsx}";
const ts = "src/**/*.{ts,tsx,mts,mtsx}";
export default [
{
files: [ts],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: [js, ts],
...oursky.configs.eslint,
},
{
files: [ts],
...oursky.configs.typescript,
},
{
files: [ts],
...oursky.configs.tsdoc,
},
{
files: [js, ts],
...oursky.configs.oursky,
},
{
files: [js, ts],
...oursky.configs.react,
},
{
files: [js, ts],
...oursky.configs["react-hooks"],
},
];
import oursky from "@oursky/eslint-plugin";
const js = "src/**/*.{js,jsx,mjs,mjsx}";
const ts = "src/**/*.{ts,tsx,mts,mtsx}";
export default [
{
files: [ts],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: [js, ts],
...oursky.configs.eslint,
},
{
files: [ts],
...oursky.configs.typescript,
},
{
files: [ts],
...oursky.configs.tsdoc,
},
{
files: [js, ts],
...oursky.configs.oursky,
},
{
files: [js, ts],
...oursky.configs.react,
},
{
files: [js, ts],
...oursky.configs["react-hooks"],
},
{
files: [js, ts],
...oursky.configs["react-native"],
},
];
You are not supposed to have other use cases at Oursky. Open an issue if you want to discuss.
You use ordinary object rest spread to override.
import oursky from "@oursky/eslint-plugin";
const js = "src/**/*.{js,jsx,mjs,mjsx}";
const ts = "src/**/*.{ts,tsx,mts,mtsx}";
export default [
{
files: [ts],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
files: [js, ts],
...oursky.configs.eslint,
},
{
files: [ts],
...oursky.configs.typescript,
rules: {
...oursky.configs.typescript.rules,
"@typescript-eslint/parameter-properties": "off",
"@typescript-eslint/no-restricted-types": [
"error",
{
"types": {
"BrokenType": "BrokenType is broken. Use NonBrokenType instead",
},
},
]
},
},
{
files: [ts],
...oursky.configs.tsdoc,
},
{
files: [js, ts],
...oursky.configs.oursky,
},
{
files: [js, ts],
...oursky.configs.react,
},
{
files: [js, ts],
...oursky.configs["react-hooks"],
},
{
files: [js, ts],
...oursky.configs["react-native"],
},
];