Skip to content

Commit

Permalink
feat: first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinhe998 committed Jun 4, 2022
1 parent 0a91d34 commit f4e3f41
Show file tree
Hide file tree
Showing 9 changed files with 7,735 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .eslintrc.js
@@ -0,0 +1,18 @@
module.exports = {
plugins: ["@typescript-eslint"],
parser: "@typescript-eslint/parser",
extends: [
"plugin:@typescript-eslint/recommended",
],
parserOptions: {
ecmaVersion: 2019,
sourceType: 'module',
},
rules: {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-explicit-any": "off",
},
};
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
/dist
/node_modules
37 changes: 37 additions & 0 deletions README.md
@@ -0,0 +1,37 @@
# Babel Plugin Transform JSX Classes

This babel plugin adds the `className` in each JSX element.

<table>
<tr>
<th>Before</th>
<th>After</th>
</tr>
<tr>
<td>
<pre>
function FancyComponent () {
return (
&lt;div&gt;
&lt;div&gt;Hello World&lt;/div&gt;
&lt;/div&gt;
)
}
</pre>
</td>
<td>
<pre>
function FancyComponent () {
return (
&lt;div class='example'&gt;
&lt;div class='example'&gt;Hello World&lt;/div&gt;
&lt;/div&gt;
)
}
</pre>
</td>
</tr>
</table>


> This plugin asumes that you are using [React](https://reactjs.org) and [Babel](https://babeljs.io) as a building tool to generate your bundle.
10 changes: 10 additions & 0 deletions babel.config.js
@@ -0,0 +1,10 @@
module.exports = (api) => {
api.cache(true)

return {
presets: [
['@babel/preset-env', { targets: { node: '12' }, loose: true }],
'@babel/preset-typescript',
],
}
}

0 comments on commit f4e3f41

Please sign in to comment.