Skip to content

Commit df514fe

Browse files
authored
Merge pull request pyscript#44 from anaconda/rb/prettier
Added prettier and eslint
2 parents 2dc4787 + d309a6c commit df514fe

20 files changed

+1689
-871
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,9 @@ venv.bak/
118118
# Rope project settings
119119
.ropeproject
120120

121-
# VS Code Files
121+
# IDE Files
122122
.vscode/
123+
.idea/
123124

124125
# mkdocs documentation
125126
/site

pyscriptjs/.eslintrc.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
extends: [
4+
'eslint:recommended',
5+
'plugin:@typescript-eslint/recommended',
6+
'plugin:@typescript-eslint/recommended-requiring-type-checking',
7+
],
8+
parserOptions: {
9+
ecmaVersion: 2020,
10+
sourceType: 'module',
11+
tsconfigRootDir: __dirname,
12+
project: ['./tsconfig.json'],
13+
extraFileExtensions: ['.svelte'],
14+
},
15+
env: {
16+
es6: true,
17+
browser: true,
18+
},
19+
overrides: [
20+
{
21+
files: ['*.svelte'],
22+
processor: 'svelte3/svelte3',
23+
},
24+
],
25+
settings: {
26+
'svelte3/typescript': require('typescript'),
27+
// ignore style tags in Svelte because of Tailwind CSS
28+
// See https://github.com/sveltejs/eslint-plugin-svelte3/issues/70
29+
'svelte3/ignore-styles': () => true,
30+
},
31+
plugins: ['svelte3', '@typescript-eslint'],
32+
ignorePatterns: ['node_modules'],
33+
rules: {
34+
'no-prototype-builtins': 'warn',
35+
'@typescript-eslint/no-unused-vars': 'warn',
36+
'@typescript-eslint/no-explicit-any': 'warn',
37+
'@typescript-eslint/no-unsafe-assignment': 'warn',
38+
'@typescript-eslint/no-unsafe-argument': 'warn',
39+
'@typescript-eslint/no-unsafe-member-access': 'warn',
40+
'@typescript-eslint/no-unsafe-call': 'warn',
41+
'@typescript-eslint/no-unsafe-return': 'warn',
42+
'@typescript-eslint/no-floating-promises': 'warn',
43+
'@typescript-eslint/restrict-plus-operands': 'warn',
44+
'@typescript-eslint/no-empty-function': 'warn',
45+
},
46+
};

pyscriptjs/.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
build
2+
node_modules
3+
4+
5+
# Ignore all HTML files
6+
*.html

pyscriptjs/.prettierrc.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
arrowParens: 'avoid',
3+
bracketSameLine: true,
4+
singleQuote: true,
5+
printWidth: 120,
6+
plugins: ['prettier-plugin-svelte'],
7+
semi: true,
8+
svelteSortOrder: 'options-styles-scripts-markup',
9+
svelteStrictMode: false,
10+
svelteIndentScriptAndStyle: true,
11+
tabWidth: 4,
12+
trailingComma: 'all',
13+
}

0 commit comments

Comments
 (0)