Skip to content

Commit

Permalink
Merge pull request #6 from leslieyip02/styling-config
Browse files Browse the repository at this point in the history
Add style rules
  • Loading branch information
Respirayson authored Jan 24, 2024
2 parents f540d71 + 67f81fe commit d382e27
Show file tree
Hide file tree
Showing 13 changed files with 678 additions and 69 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
end_of_line = lf
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
40 changes: 34 additions & 6 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,42 @@ module.exports = {
'plugin:react/jsx-runtime',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
ignorePatterns: ['dist'],
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
settings: { react: { version: '18.2' } },
plugins: ['react-refresh'],
plugins: [
'@html-eslint',
'@stylistic',
'@typescript-eslint',
'react',
'react-refresh',
],
overrides: [
{
files: ['*.html'],
parser: '@html-eslint/parser',
extends: ['plugin:@html-eslint/recommended'],
},
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
extends: ['plugin:react/recommended'],
}
],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'@html-eslint/indent': ['error', 2],
'@html-eslint/quotes': ['error', 'single'],
'@stylistic/array-bracket-spacing': ['error', 'never'],
'@stylistic/comma-dangle': ['error', 'always-multiline'],
'@stylistic/eol-last': ['error', 'always'],
'@stylistic/indent': ['error', 2],
'@stylistic/jsx-quotes': ['error', 'prefer-single'],
'@stylistic/max-len': ['error'],
'@stylistic/no-trailing-spaces': ['error'],
'@stylistic/object-curly-spacing': ['error', 'always'],
'@stylistic/quotes': ['error', 'single'],
'@stylistic/semi': ['error', 'always'],
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
globals: { 'module': true },
}
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!doctype html>
<html lang="en">
<html lang='en'>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset='UTF-8'>
<link rel='icon' type='image/svg+xml' href='/vite.svg'>
<meta name='viewport' content='width=device-width, initial-scale=1.0'>
<title>Vite + React</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.jsx"></script>
<div id='root'></div>
<script type='module' src='/src/main.jsx'></script>
</body>
</html>
Loading

0 comments on commit d382e27

Please sign in to comment.