forked from pablo-abc/svelte-markdown
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bump all deps to latest version including svelte 5, marked 15 and esl…
…int 9 with flat config upgrade.
- Loading branch information
Showing
8 changed files
with
710 additions
and
594 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import globals from "globals" | ||
import pluginJs from "@eslint/js" | ||
import svelteParser from 'svelte-eslint-parser' | ||
import sveltePlugin from 'eslint-plugin-svelte' | ||
|
||
export default [ | ||
{languageOptions: { globals: globals.browser }}, | ||
pluginJs.configs.recommended, | ||
{ | ||
name: 'Frankie WebApp', | ||
ignores: [ | ||
'vite.config.js.*', | ||
'more.eslint.config.js', | ||
], | ||
}, | ||
{ | ||
name: 'Svelte files', | ||
files: [ | ||
'src/**/*.svelte', | ||
'src/routes/**/*page.js', | ||
'src/routes/**/*layout.js', | ||
], | ||
languageOptions: { | ||
parser: svelteParser, | ||
globals: {...globals.browser}, | ||
}, | ||
plugins: { | ||
// '@stylistic/js': stylisticJs, | ||
svelte: sveltePlugin, | ||
}, | ||
rules: { | ||
// ...pluginJs.configs.recommended.rules, | ||
// ...recommended.rules, | ||
// '@stylistic/js/max-len': ['warn', {code: 250}], | ||
'no-undefined': 'off', | ||
'svelte/no-at-html-tags': 'off', | ||
'svelte/valid-compile': 'off', | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
const globals = require('globals') | ||
const js = require('@eslint/js') | ||
const stylisticJs = require('@stylistic/eslint-plugin-js') | ||
const eslintPluginSvelte = require('eslint-plugin-svelte') | ||
const svelteEslintParser = require('svelte-eslint-parser') | ||
const vitest = require('eslint-plugin-vitest') | ||
|
||
const rules = { | ||
semi: ['warn', 'never'], | ||
quotes: ['error', 'single'], | ||
'dot-location': ['warn', 'property'], | ||
'guard-for-in': ['warn'], | ||
'no-multi-spaces': ['warn'], | ||
yoda: ['warn', 'never'], | ||
camelcase: ['error'], | ||
'comma-style': ['warn'], | ||
'comma-dangle': ['warn', 'always-multiline'], | ||
'block-spacing': ['warn'], | ||
'keyword-spacing': ['warn'], | ||
'no-trailing-spaces': ['warn'], | ||
'no-unneeded-ternary': ['warn'], | ||
'no-whitespace-before-property': ['warn'], | ||
'object-curly-spacing': ['warn', 'always'], | ||
'space-before-blocks': ['warn'], | ||
'space-in-parens': ['warn'], | ||
'arrow-spacing': ['warn'], | ||
'no-duplicate-imports': ['error'], | ||
'no-var': ['error'], | ||
'prefer-const': ['warn'], | ||
'no-unused-vars': [ | ||
'warn', | ||
{ | ||
argsIgnorePattern: '^_', | ||
ignoreRestSiblings: true, | ||
}, | ||
], | ||
} | ||
|
||
|
||
const [sveltePlugin, recommended] = eslintPluginSvelte.configs['flat/recommended'] | ||
const {svelte} = sveltePlugin.plugins | ||
|
||
const config = [ | ||
{ | ||
name: 'Svelte Marked', | ||
// ignores: webappIgnores, | ||
}, | ||
{ | ||
name: 'Pure javascript files', | ||
files: [ | ||
'src/**/*.js', | ||
'tests/**/*.js', | ||
'e2e/**/*.*js', | ||
'*.cjs', | ||
'*.config.js', | ||
'*.config.cjs', | ||
], | ||
languageOptions: { | ||
sourceType: 'module', | ||
}, | ||
plugins: { | ||
'@stylistic/js': stylisticJs, | ||
// security, | ||
}, | ||
rules: { | ||
...js.configs.recommended.rules, | ||
'@stylistic/js/object-curly-newline': ['warn', { | ||
multiline: true, | ||
// 'consistent': true, | ||
minProperties: 5, | ||
}], | ||
'@stylistic/js/max-len': ['warn', {code: 250}], | ||
'no-undefined': 'warn', | ||
}, | ||
}, | ||
{ | ||
name: 'Svelte files', | ||
files: [ | ||
'src/**/*.svelte', | ||
'src/routes/**/*page.js', | ||
'src/routes/**/*layout.js', | ||
], | ||
languageOptions: { | ||
parser: svelteEslintParser, | ||
globals: {...globals.browser}, | ||
}, | ||
plugins: { | ||
'@stylistic/js': stylisticJs, | ||
svelte, | ||
}, | ||
rules: { | ||
...js.configs.recommended.rules, | ||
...recommended.rules, | ||
camelcase, | ||
'@stylistic/js/max-len': ['warn', {code: 250}], | ||
'no-undefined': 'warn', | ||
'svelte/no-at-html-tags': 'off', | ||
'svelte/valid-compile': 'off', | ||
}, | ||
}, | ||
{ | ||
files: ['tests/**/*.js'], | ||
plugins: {vitest}, | ||
rules: { | ||
...vitest.configs.recommended.rules, | ||
'vitest/max-nested-describe': ['error', {max: 3}], | ||
'sonarjs/slow-regex': 'off', | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.