Skip to content

Instantly share code, notes, and snippets.

@RyanHirsch
Last active April 11, 2018 11:53
Show Gist options
  • Save RyanHirsch/d705776e245ade20ef887e716151f8bd to your computer and use it in GitHub Desktop.
Save RyanHirsch/d705776e245ade20ef887e716151f8bd to your computer and use it in GitHub Desktop.
.NET Core + React starter away from TypeScript
{
"presets": [
"@babel/preset-react",
[
"@babel/preset-env",
{
"targets": { "browsers": "last 2 versions" },
"loose": true,
"modules": false
}
]
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread"
]
}
# editorconfig.org
root = true
[*]
indent_style = space
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
[*.js]
indent_size = 2
{
"extends": ["airbnb", "prettier", "prettier/react"],
"plugins": ["prettier"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2016,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"env": {
"es6": true,
"browser": true,
"jest": true
},
"rules": {
"react/jsx-filename-extension": 0,
"jsx-a11y/anchor-is-valid": [
"error",
{
"components": ["Link"],
"specialLink": ["to"],
"aspects": ["noHref", "invalidHref", "preferButton"]
}
]
}
}
{
"printWidth": 100,
"singleQuote": true,
"trailingComma": "es5"
}

Steps for moving moving away from the out of the box typescript to javascript with babel and linting.

# $ dotnet --version
# 2.1.104
dotnet new react -o <project-name>
npm i -D eslint-plugin-jsx-a11y eslint eslint-plugin-import eslint-plugin-react babel-loader prettier eslint-config-airbnb eslint-config-prettier babel-eslint @babel/preset-react @babel/plugin-proposal-object-rest-spread @babel/preset-env @babel/plugin-proposal-class-properties @babel/core @babel/cli babel-core@^7.0.0-0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment