Last active
June 20, 2023 02:11
-
-
Save AndreVallestero/8ffd7e4bad607c1210da8b10670fd5e7 to your computer and use it in GitHub Desktop.
SolidJS + TypeScript + ESLint + Prettier setup
This file contains hidden or 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
Show hidden characters
// env should be changed depending on the target environment | |
// plugin:@typescript-eslint/strict and @typescript-eslint/recommended-requiring-type-checking might need to be dropped depending on how much friction it causes | |
// "endOfLine" : "auto" is added to accommodate windows devs | |
{ | |
"env":{"browser":true}, | |
"extends":[ | |
"eslint:recommended", | |
"airbnb-base", | |
"airbnb-typescript/base", | |
"plugin:@typescript-eslint/recommended", | |
"plugin:@typescript-eslint/recommended-requiring-type-checking", | |
"plugin:@typescript-eslint/strict", | |
"plugin:solid/typescript", | |
"plugin:prettier/recommended" | |
], | |
"parser":"@typescript-eslint/parser", | |
"parserOptions":{"project":["./tsconfig.json"]}, | |
"plugins":["@typescript-eslint", "solid"], | |
"rules":{ | |
"import/extensions":["error", "ignorePackages",{"":"never"}], | |
"prettier/prettier":["error", {"endOfLine":"auto"}] | |
} | |
} |
This file contains hidden or 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
// To get this to work in VSCode, make sure to have the ESLint extension installed, and that the following is set in your .vscode/settings.json: | |
{ | |
"editor.codeActionsOnSave": {"source.fixAll.eslint": true}, | |
"eslint.alwaysShowStatus": true, | |
"eslint.format.enable": true, | |
"eslint.lintTask.enable": true, | |
"editor.tabSize": 2, | |
"editor.formatOnSave": true, | |
"editor.defaultFormatter": "dbaeumer.vscode-eslint", | |
} |
This file contains hidden or 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
{ | |
"name":"vite-template-solid", | |
"version":"0.0.0", | |
"description":"", | |
"scripts":{ | |
"start":"vite", | |
"dev":"vite", | |
"build":"vite build", | |
"serve":"vite preview" | |
}, | |
"license":"MIT", | |
"devDependencies":{ | |
"@typescript-eslint/eslint-plugin":"^5.43.0", | |
"@typescript-eslint/parser":"^5.43.0", | |
"eslint":"^8.28.0", | |
"eslint-config-airbnb-base":"^15.0.0", | |
"eslint-config-airbnb-typescript":"^17.0.0", | |
"eslint-config-prettier":"^8.5.0", | |
"eslint-plugin-prettier":"^4.2.1", | |
"eslint-plugin-solid":"^0.8.0", | |
"prettier":"^2.7.1", | |
"typescript":"^4.8.2", | |
"vite":"^3.0.9", | |
"vite-plugin-solid":"^2.3.0" | |
}, | |
"dependencies":{ | |
"solid-js":"^1.5.1" | |
} | |
} |
This file contains hidden or 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
{ | |
"compilerOptions":{ | |
"strict":true, | |
"target":"ESNext", | |
"module":"ESNext", | |
"moduleResolution":"node", | |
"allowSyntheticDefaultImports":true, | |
"esModuleInterop":true, | |
"jsx":"preserve", | |
"jsxImportSource":"solid-js", | |
"types":["vite/client"], | |
"noEmit":true, | |
"isolatedModules":true | |
} | |
} |
This file contains hidden or 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
import { defineConfig } from 'vite'; | |
import solidPlugin from 'vite-plugin-solid'; | |
export default defineConfig({ | |
plugins: [solidPlugin()], | |
server: { | |
port: 3000, | |
}, | |
build: { | |
target: 'esnext', | |
outDir: '_site/' | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment