Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
feat!: make users be explicit about the configs to load
Browse files Browse the repository at this point in the history
⚠️ remove auto config load based on dependencies
  • Loading branch information
nicolassutter committed Jun 8, 2023
1 parent 914c49c commit 1280123
Show file tree
Hide file tree
Showing 16 changed files with 411 additions and 361 deletions.
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"semi": false,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "always",
"singleAttributePerLine": true,
"printWidth": 80,
"jsxSingleQuote": true
}
112 changes: 52 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ Ce repo contient le paquet npm correspondant à la configuration ESLint de l'[ag

### Base

```sh
# npm, yarn, pnpm
npm i --save-dev eslint-config-alsacreations @rushstack/eslint-patch eslint
```
```sh
# npm, yarn, pnpm
npm i --save-dev eslint-config-alsacreations @rushstack/eslint-patch eslint
```

### Avec TS (optionnel)

```sh
# npm, yarn, pnpm
npm i --save-dev typescript
```
```sh
# npm, yarn, pnpm
npm i --save-dev typescript
```

### Avec Prettier (optionnel)

```sh
# npm, yarn, pnpm
npm i --save-dev prettier eslint-config-prettier
```
```sh
# npm, yarn, pnpm
npm i --save-dev prettier eslint-config-prettier
```

</details>

Expand All @@ -57,24 +57,24 @@ Ce repo contient le paquet npm correspondant à la configuration ESLint de l'[ag

### Base

```sh
# npm, yarn, pnpm
npm i --save-dev eslint-config-alsacreations @rushstack/eslint-patch eslint-plugin-vue eslint
```
```sh
# npm, yarn, pnpm
npm i --save-dev eslint-config-alsacreations @rushstack/eslint-patch eslint-plugin-vue eslint
```

### Avec TS (optionnel)

```sh
# npm, yarn, pnpm
npm i --save-dev @vue/eslint-config-typescript typescript
```
```sh
# npm, yarn, pnpm
npm i --save-dev @vue/eslint-config-typescript typescript
```

### Avec Prettier (optionnel)

```sh
# npm, yarn, pnpm
npm i --save-dev prettier @vue/eslint-config-prettier
```
```sh
# npm, yarn, pnpm
npm i --save-dev prettier @vue/eslint-config-prettier
```

</details>

Expand All @@ -83,24 +83,24 @@ Ce repo contient le paquet npm correspondant à la configuration ESLint de l'[ag

### Base

```sh
# npm, yarn, pnpm
npm i --save-dev eslint-config-alsacreations @rushstack/eslint-patch @nuxtjs/eslint-config eslint
```
```sh
# npm, yarn, pnpm
npm i --save-dev eslint-config-alsacreations @rushstack/eslint-patch @nuxtjs/eslint-config eslint
```

### Avec TS (optionnel)

```sh
# npm, yarn, pnpm
npm i --save-dev @nuxtjs/eslint-config-typescript && npm uninstall @nuxtjs/eslint-config
```
```sh
# npm, yarn, pnpm
npm i --save-dev @nuxtjs/eslint-config-typescript && npm uninstall @nuxtjs/eslint-config
```

### Avec Prettier (optionnel)

```sh
# npm, yarn, pnpm
npm i --save-dev prettier @vue/eslint-config-prettier
```
```sh
# npm, yarn, pnpm
npm i --save-dev prettier @vue/eslint-config-prettier
```

</details>

Expand All @@ -116,36 +116,28 @@ module.exports = {
root: true,
extends: [
'eslint:recommended',
// Gère l'ordre de tous les plugins installés
'alsacreations'
],
parserOptions: {
ecmaVersion: 'latest'
}
}
```

## Configuration avancée
'alsacreations/javascript',

```js
// .eslintrc.js ou équivalent
// /!\ Ne choisir que l'un ou l'autre
'alsacreations/nuxt', // Nuxt tout seul
'alsacreations/vue', // Vue tout seul

require('@rushstack/eslint-patch/modern-module-resolution')
const createConfig = require('eslint-config-alsacreations/createConfig')
// /!\ Ne choisir que l'un ou l'autre
// /!\ Ne pas choisir 'alsacreations/nuxt' ni 'alsacreations/vue'
'alsacreations/nuxt-typescript', // Nuxt + TS
'alsacreations/vue-typescript', // Vue + TS

/* eslint-env node */
module.exports = {
root: true,
extends: [
'eslint:recommended',
createConfig({
// Il est possible de spécifier les presets à ignorer
ignore: ['vue', 'nuxt']
})
// /!\ Ne pas choisir si 'alsacreations/nuxt-typescript' ou 'alsacreations/vue-typescript' sont utilisés
'alsacreations/typescript', // TS tout seul

// /!\ Ne choisir que l'un ou l'autre
'alsacreations/prettier', // Prettier tout seul
'alsacreations/prettier-vue', // Vue + Prettier
],
parserOptions: {
ecmaVersion: 'latest'
}
ecmaVersion: 'latest',
},
}
```

Expand Down
46 changes: 36 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,37 @@
"url": "https://github.com/alsacreations/eslint"
},
"exports": {
".": {
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
"./javascript": {
"require": "./dist/javascript/index.js",
"types": "./dist/javascript/index.d.ts"
},
"./createConfig": {
"require": "./dist/createConfig.js",
"types": "./dist/createConfig.d.ts"
"./nuxt": {
"require": "./dist/nuxt/index.js",
"types": "./dist/nuxt/index.d.ts"
},
"./nuxt-typescript": {
"require": "./dist/nuxt-typescript/index.js",
"types": "./dist/nuxt-typescript/index.d.ts"
},
"./prettier": {
"require": "./dist/prettier/index.js",
"types": "./dist/prettier/index.d.ts"
},
"./prettier-vue": {
"require": "./dist/prettier-vue/index.js",
"types": "./dist/prettier-vue/index.d.ts"
},
"./typescript": {
"require": "./dist/typescript/index.js",
"types": "./dist/typescript/index.d.ts"
},
"./vue": {
"require": "./dist/vue/index.js",
"types": "./dist/vue/index.d.ts"
},
"./vue-typescript": {
"require": "./dist/vue/index.js",
"types": "./dist/vue/index.d.ts"
}
},
"scripts": {
Expand All @@ -41,13 +65,15 @@
"bumpp": "^8.2.1",
"eslint": "^8.33.0",
"husky": "^8.0.3",
"prettier": "^2.8.8",
"rimraf": "^4.1.2",
"typescript": "^4.9.5"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.51.0",
"@typescript-eslint/parser": "^5.51.0",
"eslint-define-config": "^1.15.0",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"consola": "^3.1.0",
"eslint-define-config": "^1.12.0",
"local-pkg": "^0.4.3"
}
}
}
35 changes: 22 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1280123

Please sign in to comment.