Skip to content

Commit

Permalink
style: format to new tabs behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
mheob committed Sep 16, 2022
1 parent 7b8d5d4 commit c667f0c
Show file tree
Hide file tree
Showing 20 changed files with 320 additions and 314 deletions.
6 changes: 6 additions & 0 deletions .changeset/lemon-cheetahs-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@mheob/eslint-config': patch
'@mheob/prettier-config': patch
---

Format all files to the new tabs instead of spaces behaviour
4 changes: 2 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import('eslint').ESLint.ConfigData} */
module.exports = {
root: true,
extends: ['@mheob/eslint-config'],
root: true,
extends: ['@mheob/eslint-config'],
};
46 changes: 23 additions & 23 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"labels": ["dependencies"],
"rangeStrategy": "replace",
"separateMajorMinor": true,
"dependencyDashboard": true,
"dependencyDashboardAutoclose": false,
"major": {
"dependencyDashboardApproval": true
},
"stabilityDays": 3,
"prCreation": "not-pending",
"prConcurrentLimit": 5,
"timezone": "Europe/Berlin",
"schedule": ["before 5am on Wednesday"],
"packageRules": [
{
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch"
}
]
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base"],
"labels": ["dependencies"],
"rangeStrategy": "replace",
"separateMajorMinor": true,
"dependencyDashboard": true,
"dependencyDashboardAutoclose": false,
"major": {
"dependencyDashboardApproval": true
},
"stabilityDays": 3,
"prCreation": "not-pending",
"prConcurrentLimit": 5,
"timezone": "Europe/Berlin",
"schedule": ["before 5am on Wednesday"],
"packageRules": [
{
"matchPackagePatterns": ["*"],
"matchUpdateTypes": ["minor", "patch"],
"groupName": "all non-major dependencies",
"groupSlug": "all-minor-patch"
}
]
}
4 changes: 2 additions & 2 deletions .husky/post-merge
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"

hasChanged() {
echo "$changedFiles" | grep -q "$1"
echo "$changedFiles" | grep -q "$1"
}

if hasChanged 'pnpm-lock.yaml'; then
pnpm install
pnpm install
fi
2 changes: 1 addition & 1 deletion .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
...require('@mheob/prettier-config'),
...require('@mheob/prettier-config'),
};
10 changes: 5 additions & 5 deletions packages/eslint-config/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/** @type {import('eslint').ESLint.ConfigData} */
module.exports = {
extends: ['./base.js'],
env: { node: true },
rules: {
'unicorn/prefer-module': 'off',
},
extends: ['./base.js'],
env: { node: true },
rules: {
'unicorn/prefer-module': 'off',
},
};
48 changes: 24 additions & 24 deletions packages/eslint-config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ pnpm add -D @mheob/eslint-config
```js
// .eslintrc.cjs
module.exports = {
root: true, // optional
extends: ['@mheob/eslint-config'],
root: true, // optional
extends: ['@mheob/eslint-config'],
};
```

Expand All @@ -39,8 +39,8 @@ module.exports = {
```js
// .eslintrc.cjs
module.exports = {
root: true, // optional
extends: ['@mheob/eslint-config/react'],
root: true, // optional
extends: ['@mheob/eslint-config/react'],
};
```

Expand All @@ -49,8 +49,8 @@ module.exports = {
```js
// .eslintrc.cjs
module.exports = {
root: true, // optional
extends: ['@mheob/eslint-config/next'],
root: true, // optional
extends: ['@mheob/eslint-config/next'],
};
```

Expand All @@ -59,12 +59,12 @@ If you need to override some rules you can do it this way:
```js
// .eslintrc.cjs
module.exports = {
root: true, // optional
extends: ['@mheob/eslint-config'],
rules: {
'prettier/prettier': 'off',
'no-console': 'warn',
},
root: true, // optional
extends: ['@mheob/eslint-config'],
rules: {
'prettier/prettier': 'off',
'no-console': 'warn',
},
};
```

Expand All @@ -73,17 +73,17 @@ Or override rules specified for some files:
```js
// .eslintrc.cjs
module.exports = {
root: true, // optional
extends: ['@mheob/eslint-config'],
overrides: [
{
files: ['*.jsx', '*.tsx'],
settings: { react: { version: 'detect' } },
rules: {
'react/jsx-no-useless-fragment': 'warn',
'react/react-in-jsx-scope': 'off',
},
},
],
root: true, // optional
extends: ['@mheob/eslint-config'],
overrides: [
{
files: ['*.jsx', '*.tsx'],
settings: { react: { version: 'detect' } },
rules: {
'react/jsx-no-useless-fragment': 'warn',
'react/react-in-jsx-scope': 'off',
},
},
],
};
```
92 changes: 46 additions & 46 deletions packages/eslint-config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,50 @@
* @type {import('eslint').ESLint.ConfigData}
*/
module.exports = {
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:unicorn/recommended', 'plugin:prettier/recommended'],
rules: {
'prettier/prettier': 'warn',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-implicit-coercion': ['error', { allow: ['!!', '+', '~'] }],
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'unicorn/import-index': 'error',
'unicorn/prevent-abbreviations': [
'error',
{
replacements: {
args: false,
doc: false,
env: false,
props: false,
},
},
],
},
overrides: [
{
files: ['*.cjs'],
env: { node: true },
},
{
files: ['*.js', '*.ts'],
rules: { 'unicorn/filename-case': ['error', { case: 'camelCase' }] },
},
{
files: ['*.ts', '*.tsx'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/explicit-function-return-type': [
'warn',
{ allowExpressions: true, allowTypedFunctionExpressions: true },
],
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/quotes': ['warn', 'single', { avoidEscape: true }],
},
},
],
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:unicorn/recommended', 'plugin:prettier/recommended'],
rules: {
'prettier/prettier': 'warn',
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-implicit-coercion': ['error', { allow: ['!!', '+', '~'] }],
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
'unicorn/import-index': 'error',
'unicorn/prevent-abbreviations': [
'error',
{
replacements: {
args: false,
doc: false,
env: false,
props: false,
},
},
],
},
overrides: [
{
files: ['*.cjs'],
env: { node: true },
},
{
files: ['*.js', '*.ts'],
rules: { 'unicorn/filename-case': ['error', { case: 'camelCase' }] },
},
{
files: ['*.ts', '*.tsx'],
extends: ['plugin:@typescript-eslint/recommended'],
rules: {
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/explicit-function-return-type': [
'warn',
{ allowExpressions: true, allowTypedFunctionExpressions: true },
],
'@typescript-eslint/no-unused-vars': [
'warn',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/quotes': ['warn', 'single', { avoidEscape: true }],
},
},
],
};
2 changes: 1 addition & 1 deletion packages/eslint-config/next.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
* @type {import('eslint').ESLint.ConfigData}
*/
module.exports = {
extends: ['./react', 'next/core-web-vitals'],
extends: ['./react', 'next/core-web-vitals'],
};
104 changes: 52 additions & 52 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
{
"name": "@mheob/eslint-config",
"version": "2.1.0",
"description": "My personal configuration for eslint.",
"keywords": [
"eslint",
"config"
],
"homepage": "https://github.com/mheob/config/tree/main/packages/eslint-config",
"bugs": "https://github.com/mheob/config/issues",
"repository": {
"type": "git",
"url": "https://github.com/mheob/config.git"
},
"license": "MIT",
"author": "Alexander Böhm <tools@boehm.work>",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.js",
"index.d.ts",
"base.js",
"next.js",
"react.js",
"LICENSE",
"README.md"
],
"scripts": {
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"lint": "eslint **/*.cjs --fix",
"sort-package-json": "pnpm dlx sort-package-json"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"eslint-config-next": "^12.3.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-unicorn": "^43.0.2"
},
"devDependencies": {
"eslint": "^8.23.1",
"prettier": "^2.7.1",
"typescript": "^4.8.3"
},
"peerDependencies": {
"eslint": "^8.23.1",
"prettier": "^2.7.1"
},
"publishConfig": {
"access": "public"
}
"name": "@mheob/eslint-config",
"version": "2.1.0",
"description": "My personal configuration for eslint.",
"keywords": [
"eslint",
"config"
],
"homepage": "https://github.com/mheob/config/tree/main/packages/eslint-config",
"bugs": "https://github.com/mheob/config/issues",
"repository": {
"type": "git",
"url": "https://github.com/mheob/config.git"
},
"license": "MIT",
"author": "Alexander Böhm <tools@boehm.work>",
"main": "index.js",
"types": "index.d.ts",
"files": [
"index.js",
"index.d.ts",
"base.js",
"next.js",
"react.js",
"LICENSE",
"README.md"
],
"scripts": {
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
"lint": "eslint **/*.cjs --fix",
"sort-package-json": "pnpm dlx sort-package-json"
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"eslint-config-next": "^12.3.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.8",
"eslint-plugin-unicorn": "^43.0.2"
},
"devDependencies": {
"eslint": "^8.23.1",
"prettier": "^2.7.1",
"typescript": "^4.8.3"
},
"peerDependencies": {
"eslint": "^8.23.1",
"prettier": "^2.7.1"
},
"publishConfig": {
"access": "public"
}
}
Loading

0 comments on commit c667f0c

Please sign in to comment.