mirror of
https://github.com/pyscript/pyscript.git
synced 2022-05-01 19:47:48 +03:00
[PYS-12] Add eslint and prettier
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -118,8 +118,9 @@ venv.bak/
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# VS Code Files
|
||||
# IDE Files
|
||||
.vscode/
|
||||
.idea/
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
33
pyscriptjs/.eslintrc.js
Normal file
33
pyscriptjs/.eslintrc.js
Normal file
@@ -0,0 +1,33 @@
|
||||
module.exports = {
|
||||
parser: '@typescript-eslint/parser',
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'plugin:@typescript-eslint/recommended-requiring-type-checking'
|
||||
],
|
||||
parserOptions: {
|
||||
ecmaVersion: 2020,
|
||||
sourceType: 'module',
|
||||
tsconfigRootDir: __dirname,
|
||||
project: ['./tsconfig.json'],
|
||||
extraFileExtensions: ['.svelte']
|
||||
},
|
||||
env: {
|
||||
es6: true,
|
||||
browser: true
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ['*.svelte'],
|
||||
processor: 'svelte3/svelte3'
|
||||
}
|
||||
],
|
||||
settings: {
|
||||
'svelte3/typescript': require('typescript'),
|
||||
// ignore style tags in Svelte because of Tailwind CSS
|
||||
// See https://github.com/sveltejs/eslint-plugin-svelte3/issues/70
|
||||
'svelte3/ignore-styles': () => true
|
||||
},
|
||||
plugins: ['svelte3', '@typescript-eslint'],
|
||||
ignorePatterns: ['node_modules'],
|
||||
}
|
||||
6
pyscriptjs/.prettierignore
Normal file
6
pyscriptjs/.prettierignore
Normal file
@@ -0,0 +1,6 @@
|
||||
build
|
||||
node_modules
|
||||
|
||||
|
||||
# Ignore all HTML files
|
||||
*.html
|
||||
13
pyscriptjs/.prettierrc.js
Normal file
13
pyscriptjs/.prettierrc.js
Normal file
@@ -0,0 +1,13 @@
|
||||
module.exports = {
|
||||
arrowParens: 'avoid',
|
||||
bracketSameLine: true,
|
||||
singleQuote: true,
|
||||
printWidth: 120,
|
||||
plugins: ['prettier-plugin-svelte'],
|
||||
semi: false,
|
||||
svelteSortOrder: 'options-styles-scripts-markup',
|
||||
svelteStrictMode: false,
|
||||
svelteIndentScriptAndStyle: true,
|
||||
tabWidth: 2,
|
||||
trailingComma: 'all',
|
||||
}
|
||||
743
pyscriptjs/package-lock.json
generated
743
pyscriptjs/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -5,15 +5,26 @@
|
||||
"build": "NODE_ENV=production rollup -c",
|
||||
"dev": "rollup -c -w",
|
||||
"start": "sirv public --no-clear --port 8080",
|
||||
"validate": "svelte-check"
|
||||
"validate": "svelte-check",
|
||||
"format:check": "prettier --check './src/**/*.{js,svelte,html,ts}'",
|
||||
"format": "prettier --write './src/**/*.{js,svelte,html,ts}'",
|
||||
"lint": "eslint './src/**/*.{js,svelte,html,ts}'",
|
||||
"lint:fix": "eslint --fix './src/**/*.{js,svelte,html,ts}'",
|
||||
"xprelint": "npm run format"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^17.0.0",
|
||||
"@rollup/plugin-node-resolve": "^11.0.0",
|
||||
"@rollup/plugin-typescript": "^8.1.0",
|
||||
"@tsconfig/svelte": "^1.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
||||
"@typescript-eslint/parser": "^5.20.0",
|
||||
"autoprefixer": "^10.2.3",
|
||||
"eslint": "^8.14.0",
|
||||
"eslint-plugin-svelte3": "^3.4.1",
|
||||
"postcss": "^8.2.4",
|
||||
"prettier": "^2.6.2",
|
||||
"prettier-plugin-svelte": "^2.7.0",
|
||||
"rollup": "^2.3.4",
|
||||
"rollup-plugin-css-only": "^3.1.0",
|
||||
"rollup-plugin-livereload": "^2.0.0",
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
/** Requests the runtime types from the svelte modules by default. Needed for TS files or else you get errors. */
|
||||
"types": ["svelte"],
|
||||
|
||||
"strict": false,
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
|
||||
Reference in New Issue
Block a user