Skip to content

Commit

Permalink
refactor: use better prettier standards
Browse files Browse the repository at this point in the history
  • Loading branch information
orefalo committed Jun 27, 2024
1 parent e6e73bb commit 71e2b12
Show file tree
Hide file tree
Showing 54 changed files with 2,958 additions and 2,861 deletions.
10 changes: 5 additions & 5 deletions .commitlintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [0, 'always', 100],
'scope-case': [0, 'always', 'pascal-case']
}
extends: ['@commitlint/config-conventional'],
rules: {
'header-max-length': [0, 'always', 100],
'scope-case': [0, 'always', 'pascal-case']
}
};
86 changes: 43 additions & 43 deletions .cz-config.cjs
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
module.exports = {
types: [
{ value: 'feat', name: '✨ feat:\tAdding a new feature' },
{ value: 'fix', name: '🐛 fix:\tFixing a bug' },
{ value: 'docs', name: '📝 docs:\tAdd or update documentation' },
{
value: 'style',
name: '💄 style:\tAdd or update styles, ui or ux'
},
{
value: 'refactor',
name: '♻️ refactor:\tCode change that neither fixes a bug nor adds a feature'
},
{
value: 'perf',
name: '⚡️ perf:\tCode change that improves performance'
},
{
value: 'test',
name: '✅ test:\tAdding tests cases'
},
{
value: 'chore',
name: '🚚 chore:\tChanges to the build process or auxiliary tools\n\t\tand libraries such as documentation generation'
},
{ value: 'revert', name: '⏪️ revert:\tRevert to a commit' },
{
value: 'build',
name: '👷 build:\tAdd or update regards to build process'
},
{
value: 'ci',
name: '💚 ci:\tAdd or update regards to build process'
}
],
scopes: [],
types: [
{ value: 'feat', name: '✨ feat:\tAdding a new feature' },
{ value: 'fix', name: '🐛 fix:\tFixing a bug' },
{ value: 'docs', name: '📝 docs:\tAdd or update documentation' },
{
value: 'style',
name: '💄 style:\tAdd or update styles, ui or ux'
},
{
value: 'refactor',
name: '♻️ refactor:\tCode change that neither fixes a bug nor adds a feature'
},
{
value: 'perf',
name: '⚡️ perf:\tCode change that improves performance'
},
{
value: 'test',
name: '✅ test:\tAdding tests cases'
},
{
value: 'chore',
name: '🚚 chore:\tChanges to the build process or auxiliary tools\n\t\tand libraries such as documentation generation'
},
{ value: 'revert', name: '⏪️ revert:\tRevert to a commit' },
{
value: 'build',
name: '👷 build:\tAdd or update regards to build process'
},
{
value: 'ci',
name: '💚 ci:\tAdd or update regards to build process'
}
],
scopes: [],

scopeOverrides: {
fix: [{ name: 'merge' }, { name: 'style' }, { name: 'test' }, { name: 'hotfix' }]
},
scopeOverrides: {
fix: [{ name: 'merge' }, { name: 'style' }, { name: 'test' }, { name: 'hotfix' }]
},

allowCustomScopes: true,
allowBreakingChanges: ['feat', 'fix'],
// skip any questions you want
skipQuestions: ['scope', 'footer', 'breaking'],
subjectLimit: 100
allowCustomScopes: true,
allowBreakingChanges: ['feat', 'fix'],
// skip any questions you want
skipQuestions: ['scope', 'footer', 'breaking'],
subjectLimit: 100
};
22 changes: 11 additions & 11 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 120,
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": "*.svelte",
"options": { "parser": "svelte" }
}
]
"useTabs": false,
"tabWidth": 2,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte"],
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }],
"htmlWhitespaceSensitivity": "ignore",
"bracketSameLine": true,
"semi": true,
"singleQuote": true,
"arrowParens": "avoid"
}
40 changes: 20 additions & 20 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"node_modules": true,
".vscode": true,
".husky": true
},
"hide-files.files": ["node_modules", ".vscode", ".husky"],
"files.eol": "\n",
"editor.insertSpaces": false,
"[typescript]": {
"editor.tabSize": 4
},
"[javascript]": {
"editor.tabSize": 4
}
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"node_modules": true,
".vscode": true,
".husky": true
},
"hide-files.files": ["node_modules", ".vscode", ".husky"],
"files.eol": "\n",
"editor.insertSpaces": false,
"[typescript]": {
"editor.tabSize": 4
},
"[javascript]": {
"editor.tabSize": 4
}
}
111 changes: 58 additions & 53 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,62 +10,67 @@ import pkg from 'eslint-gitignore';
const { readGitignoreFiles } = pkg;

function removeDuplicates(arr) {
return arr.filter((value, index, self) => self.indexOf(value) === index);
return arr.filter((value, index, self) => self.indexOf(value) === index);
}

/** @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,
NodeJS: true
}
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: removeDuplicates([...readGitignoreFiles({ cwd: __dirname }), '**/.svelte-kit/', '**/_app/', 'package/'])
},
{
rules: {
eqeqeq: 'error',
'prefer-const': 'off',
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs['flat/recommended'],
prettier,
...svelte.configs['flat/prettier'],
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
NodeJS: true
}
}
},
{
files: ['**/*.svelte'],
languageOptions: {
parserOptions: {
parser: ts.parser
}
}
},
{
ignores: removeDuplicates([
...readGitignoreFiles({ cwd: __dirname }),
'**/.svelte-kit/',
'**/_app/',
'package/'
])
},
{
rules: {
eqeqeq: 'error',
'prefer-const': 'off',

'@typescript-eslint/no-explicit-any': 'off',
// this will configure:
// const _a = 'unused, with underscore, no warning'
// const b = 'unused, no underscore, warning'
// note you must disable the base rule
// as it can report incorrect errors
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn', // or "error"
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
],
// We need to use {@html} in the demo site for code highlight
'svelte/no-at-html-tags': 'off',
// css is global and incorrectly reported as unused by the linter
'svelte/valid-compile': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-expressions': 'off'
}
}
'@typescript-eslint/no-explicit-any': 'off',
// this will configure:
// const _a = 'unused, with underscore, no warning'
// const b = 'unused, no underscore, warning'
// note you must disable the base rule
// as it can report incorrect errors
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn', // or "error"
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_'
}
],
// We need to use {@html} in the demo site for code highlight
'svelte/no-at-html-tags': 'off',
// css is global and incorrectly reported as unused by the linter
'svelte/valid-compile': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-expressions': 'off'
}
}
];
Loading

0 comments on commit 71e2b12

Please sign in to comment.