Skip to content

Commit

Permalink
Merge pull request #166 from JHWelch/use-jhwelch-eslint
Browse files Browse the repository at this point in the history
use jhwelch eslint config
  • Loading branch information
JHWelch authored Oct 6, 2024
2 parents ede2ca6 + 8afe664 commit fcabf8b
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 163 deletions.
107 changes: 14 additions & 93 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,94 +1,15 @@
import typescriptEslint from '@typescript-eslint/eslint-plugin'
import parser from 'vue-eslint-parser'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import js from '@eslint/js'
import { FlatCompat } from '@eslint/eslintrc'
import stylistic from '@stylistic/eslint-plugin'

const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
})

export default [{
ignores: [
'**/node_modules',
'**/dist',
'built',
],
}, ...compat.extends(
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:vue/vue3-recommended',
), {
plugins: {
'@typescript-eslint': typescriptEslint,
'@stylistic': stylistic,
},

languageOptions: {
parser: parser,
ecmaVersion: 5,
sourceType: 'script',

parserOptions: {
parser: '@typescript-eslint/parser',
import jhwelch from '@jhwelch/eslint-config'

export default [
...jhwelch,
{
ignores: [
'built',
],
},{
rules: {
'no-restricted-imports': ['error', {
patterns: ['.*'], // Disable all relative imports
}],
},
},

rules: {
'comma-dangle': ['error', 'always-multiline'],

'no-console': ['error', {
allow: ['warn', 'error'],
}],

'@stylistic/indent': ['error', 2],

'@stylistic/no-multiple-empty-lines': ['error', { max: 1 }],

'@stylistic/no-multi-spaces': 'error',

'quote-props': ['error', 'as-needed'],

'max-len': ['error', {
ignoreStrings: true,
ignoreTrailingComments: true,
ignoreUrls: true,
tabWidth: 2,
}],

'no-restricted-imports': ['error', {
patterns: ['.*'], // Disable all relative imports
}],

'object-curly-spacing': ['error', 'always'],

quotes: ['error', 'single', {
avoidEscape: true,
}],

semi: ['error', 'never'],
'space-before-function-paren': ['error', 'always'],

'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
}],

'vue/multi-word-component-names': 'off',

'vue/comma-dangle': ['error', 'always-multiline'],
},
}, {
files: ['**/*.vue'],

rules: {
'max-len': 'off',
},
}]
}]
169 changes: 104 additions & 65 deletions package-lock.json

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

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,9 @@
"author": "Jordan Welch",
"license": "MIT",
"devDependencies": {
"@eslint/js": "^9.8.0",
"@stylistic/eslint-plugin": "^2.9.0",
"@typescript-eslint/eslint-plugin": "^8.0.1",
"@typescript-eslint/parser": "^8.0.1",
"@jhwelch/eslint-config": "^1.0.1",
"concurrently": "^9.0.1",
"eslint": "^9.9.1",
"eslint-plugin-vue": "^9.27.0",
"mjml": "^4.14.1"
}
}

0 comments on commit fcabf8b

Please sign in to comment.