Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
michealparks committed Jun 6, 2024
1 parent 1ddbf0a commit cf93a3a
Show file tree
Hide file tree
Showing 16 changed files with 1,653 additions and 1,354 deletions.
13 changes: 10 additions & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
'use strict'

module.exports = {
env: {
browser: true,
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:all',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/strict',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:unicorn/all',
'prettier',
'plugin:svelte/recommended',
'plugin:svelte/prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
extraFileExtensions: ['.svelte'],
project: ['./tsconfig.json'],
project: './tsconfig.json',
},
root: true,
overrides: [
Expand All @@ -35,6 +39,9 @@ module.exports = {
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
},
],
rules: {
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20

Expand Down
2 changes: 1 addition & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"singleQuote": true,
"singleAttributePerLine": true,
"trailingComma": "es5",
"printWidth": 100,
"printWidth": 80,

"tabWidth": 2,
"useTabs": true,
Expand Down
109 changes: 109 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
import js from '@eslint/js'
import ts from 'typescript-eslint'
import svelte from 'eslint-plugin-svelte'
import prettier from 'eslint-config-prettier'
import globals from 'globals'

/** @type {import('eslint').Linter.FlatConfig[]} */
export default [
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser,
},
},
},
{
ignores: ['build/', '.svelte-kit/', 'dist/'],
},
{
rules: {
'array-bracket-newline': ['error', 'consistent'],
'array-element-newline': 'off',
'arrow-body-style': 'off',
camelcase: ['error', { properties: 'never' }],
'capitalized-comments': 'off',
'comma-dangle': [
'error',
{
arrays: 'always-multiline',
exports: 'never',
functions: 'never',
imports: 'never',
objects: 'always-multiline',
},
],
complexity: 'off',
'default-case': 'off',
'default-last-param': 'off',
'dot-location': ['error', 'property'],
'func-names': 'off',
'function-call-argument-newline': ['error', 'consistent'],
'id-length': 'off',
'init-declarations': 'off',
'linebreak-style': ['error', 'unix'],
'lines-around-comment': 'off',
'lines-between-class-members': 'off',
'max-len': ['error', { code: 140 }],
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-params': 'off',
'max-statements': 'off',
'multiline-comment-style': 'off',
'multiline-ternary': ['error', 'always-multiline'],
'no-bitwise': 'off',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-continue': 'off',
'no-extra-parens': 'off',
'no-magic-numbers': 'off',
'no-ternary': 'off',
'no-undefined': 'off',
'no-undef-init': 'off',
'object-curly-spacing': ['error', 'always'],
'object-property-newline': [
'error',
{ allowAllPropertiesOnSameLine: true },
],
'one-var': ['error', 'never'],
'padded-blocks': ['error', 'never'],
'prefer-destructuring': 'off',
'sort-keys': 'off',
'sort-imports': 'off',
'quote-props': ['error', 'consistent-as-needed'],
quotes: ['error', 'single'],
semi: ['error', 'never'],

'unicorn/no-useless-undefined': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/no-keyword-prefix': ['error', { checkProperties: false }],
'unicorn/no-array-for-each': 'off',
'unicorn/no-null': 'off',
'unicorn/filename-case': [
'error',
{
cases: {
camelCase: true,
pascalCase: true,
},
},
],

'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
]
Loading

0 comments on commit cf93a3a

Please sign in to comment.