Skip to content

Commit

Permalink
feat: eslint config
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderl19 committed May 13, 2024
1 parent 92ba580 commit b6b6029
Show file tree
Hide file tree
Showing 6 changed files with 1,975 additions and 1,949 deletions.
5 changes: 5 additions & 0 deletions .changeset/nervous-vans-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@alexanderliu/eslint-config": minor
---

initial
1 change: 1 addition & 0 deletions packages/alexanderliu-eslint-config/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@alexanderliu/prettier-config"
67 changes: 67 additions & 0 deletions packages/alexanderliu-eslint-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
export default {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier',
],
rules: {
'import/export': 2,
'import/no-named-as-default': 1,
'import/no-named-as-default-member': 1,
'import/default': 2,
'import/namespace': 2,
'import/no-duplicates': 2,
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'import/order': [
'error',
{
groups: ['type', 'builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
pathGroups: [
{
pattern: '$app/**',
group: 'external',
position: 'before',
},
{
pattern: '$env/**',
group: 'external',
position: 'before',
},
{
pattern: '$lib/**',
group: 'internal',
},
],
distinctGroup: true,
pathGroupsExcludedImportTypes: ['type'],
},
],
},
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'import'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte'],
},
env: {
browser: true,
es2017: true,
node: true,
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
},
],
globals: {
NodeJS: true,
},
};
25 changes: 25 additions & 0 deletions packages/alexanderliu-eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "@alexanderliu/eslint-config",
"version": "0.0.0",
"description": "",
"type": "module",
"main": "index.js",
"scripts": {
"format:check": "prettier --check .",
"format:write": "prettier --write ."
},
"dependencies": {
"@typescript-eslint/eslint-plugin": "7.8.0",
"@typescript-eslint/parser": "7.8.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-svelte": "2.39.0"
},
"devDependencies": {
"@alexanderliu/prettier-config": "workspace:*",
"prettier": "3.2.5"
},
"peerDependencies": {
"eslint": "8.56.0"
}
}
9 changes: 9 additions & 0 deletions packages/alexanderliu-eslint-config/turbo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": ["//"],
"pipeline": {
"format:check": {},
"format:write": {
"cache": false
}
}
}
Loading

0 comments on commit b6b6029

Please sign in to comment.