Skip to content

GreenPie/eslint-config-greenpie

Repository files navigation

Pretty tough linting configs

npm version

This package provides ESLint's shared config that designed to be strict as hell.

Usage

Install required packages:

  • npm install eslint-config-greenpie oxlint typescript-eslint --save-dev

Then add the following code to your local .oxlintrc.json file:

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",

  "extends": [
    "./node_modules/eslint-config-greenpie/configs/oxlintrc.jsonc"
  ]
}

And the following code to eslint.config.js file:

import tsEslint from 'typescript-eslint';
import { configs } from 'eslint-config-greenpie';

export default tsEslint.config(
  ...configs.default,
  ...configs.vue
);

or see more examples below.

Configs (ESLint)

Config Description
default Includes js and ts configs
js Includes JavaScript rules
ts Includes TypeScript rules
vue Includes rules for Vue.js

Config (oxlint)

Oxlint has one unified configuration for all supported languages (.js, .ts, .vue). You can granually configure it in your local .oxlintrc.json file.

Related ESLint rules are disabled by default if supported by oxlint.

Configuration examples

Oxlint

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",

  "extends": [
    "./node_modules/eslint-config-greenpie/configs/oxlintrc.jsonc"
  ],

  "rules": {
    "eslint/no-magic-numbers": "off",
  },

  "overrides": [{
    "files": ["src/**/*.{ts,vue}"],

    "env": {
      "browser": true
    }
  }, {
    "files": ["vite.config.mts"],

    "env": {
      "node": true
    }
  }]
}

JS/TS rules

import { configs } from 'eslint-config-greenpie';

export default [
  ...configs.js
];

JS + Vue

import { configs } from 'eslint-config-greenpie';

export default [
  ...configs.js,
  ...configs.vue
];

JS + TS + Vue

You will probably need to configure another parser for the <script> tag.

import { configs } from 'eslint-config-greenpie';

export default [
  ...configs.default,
  ...configs.vue
];

Links

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •