Steps for moving moving away from the out of the box typescript to javascript with babel and linting.
Last active
April 11, 2018 11:53
-
-
Save RyanHirsch/d705776e245ade20ef887e716151f8bd to your computer and use it in GitHub Desktop.
.NET Core + React starter away from TypeScript
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
{ | |
"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" | |
] | |
} |
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
# 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 |
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
{ | |
"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"] | |
} | |
] | |
} | |
} |
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
{ | |
"printWidth": 100, | |
"singleQuote": true, | |
"trailingComma": "es5" | |
} |
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
# $ dotnet --version | |
# 2.1.104 | |
dotnet new react -o <project-name> |
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
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