mirror of
https://github.com/vuejs/babel-plugin-jsx.git
synced 2025-01-26 16:19:09 +08:00
chore: improve setup of the tooling (#4)
* chore: lockfile should be committed to the repo See https://classic.yarnpkg.com/blog/2016/11/24/lockfiles-for-all/ * chore: explicitly set the npm client to yarn * chore: set up yarn workspaces * chore: use jest.config.js See: https://jestjs.io/docs/en/configuration Better follow the convention than to define yet another config file name * test: the `globals` configuration is redundant * chore: prefer babel.config.js over .babelrc See https://babeljs.io/docs/en/config-files * chore: the jsxInjection alias is extraneous * chore: add .js extension to eslint config It is the preferred configuration file format. https://eslint.org/docs/user-guide/configuring#configuration-file-formats Also deleted the jasmine env as it's not used in this project. * chore: downgrade to eslint v6 for compatibility with other dependencies * chore: use eslint-config-airbnb-base instead of the full airbnb config * chore: remove babel-eslint Syntax used in this repo can already be parsed with the default ESLint parser * chore: add missing peer dependency for `@vue/test-utils` * chore: enable useWorkspaces in lerna
This commit is contained in:
parent
5f7c77ad88
commit
9c464f4ce5
19
.eslintrc
19
.eslintrc
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"root": true,
|
|
||||||
"env": {
|
|
||||||
"browser": true,
|
|
||||||
"node": true,
|
|
||||||
"jasmine": true,
|
|
||||||
"jest": true,
|
|
||||||
"es6": true
|
|
||||||
},
|
|
||||||
"extends": "eslint-config-airbnb/base",
|
|
||||||
"parser": "babel-eslint",
|
|
||||||
"rules": {
|
|
||||||
"no-nested-ternary": [0],
|
|
||||||
"no-param-reassign": [0],
|
|
||||||
"no-use-before-define": [0],
|
|
||||||
"no-plusplus": [0],
|
|
||||||
"import/no-extraneous-dependencies": [0]
|
|
||||||
}
|
|
||||||
}
|
|
23
.eslintrc.js
Normal file
23
.eslintrc.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 2020,
|
||||||
|
ecmaFeatures: {
|
||||||
|
jsx: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
node: true,
|
||||||
|
jest: true,
|
||||||
|
es6: true,
|
||||||
|
},
|
||||||
|
extends: 'eslint-config-airbnb-base',
|
||||||
|
rules: {
|
||||||
|
'no-nested-ternary': [0],
|
||||||
|
'no-param-reassign': [0],
|
||||||
|
'no-use-before-define': [0],
|
||||||
|
'no-plusplus': [0],
|
||||||
|
'import/no-extraneous-dependencies': [0],
|
||||||
|
},
|
||||||
|
};
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -14,7 +14,6 @@ pids
|
|||||||
*.pid
|
*.pid
|
||||||
*.seed
|
*.seed
|
||||||
*.pid.lock
|
*.pid.lock
|
||||||
yarn.lock
|
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||||
lib-cov
|
lib-cov
|
||||||
@ -103,5 +102,3 @@ dist
|
|||||||
|
|
||||||
# TernJS port file
|
# TernJS port file
|
||||||
.tern-port
|
.tern-port
|
||||||
|
|
||||||
package-lock.json
|
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
"npmClient": "yarn",
|
||||||
|
"useWorkspaces": true,
|
||||||
"packages": [
|
"packages": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
{
|
{
|
||||||
|
"private": true,
|
||||||
|
"workspaces": [
|
||||||
|
"packages/*"
|
||||||
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"publish": "lerna publish"
|
"publish": "lerna publish"
|
||||||
},
|
},
|
||||||
@ -8,9 +12,8 @@
|
|||||||
"jsx"
|
"jsx"
|
||||||
],
|
],
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-eslint": "^10.1.0",
|
"eslint": "^6.8.0",
|
||||||
"eslint": "^7.0.0",
|
"eslint-config-airbnb-base": "^14.1.0",
|
||||||
"eslint-config-airbnb": "^18.1.0",
|
|
||||||
"eslint-plugin-import": "^2.20.2",
|
"eslint-plugin-import": "^2.20.2",
|
||||||
"lerna": "^3.19.0"
|
"lerna": "^3.19.0"
|
||||||
}
|
}
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"presets": [
|
|
||||||
[
|
|
||||||
"@babel/env",
|
|
||||||
{
|
|
||||||
// "modules": "cjs"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
["./src/index.js", { "transformOn": true }]
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
const { h, mergeProps, withDirectives } = require('vue');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
globals: {
|
|
||||||
'_h': h,
|
|
||||||
'_mergeProps': mergeProps,
|
|
||||||
'_withDirectives': withDirectives
|
|
||||||
},
|
|
||||||
setupFiles: ['./test/setup.js'],
|
|
||||||
}
|
|
13
packages/babel-plugin-jsx/babel.config.js
Normal file
13
packages/babel-plugin-jsx/babel.config.js
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
[
|
||||||
|
'@babel/env',
|
||||||
|
{
|
||||||
|
// "modules": "cjs"
|
||||||
|
},
|
||||||
|
],
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
['./src/index.js', { transformOn: true }],
|
||||||
|
],
|
||||||
|
};
|
3
packages/babel-plugin-jsx/jest.config.js
Normal file
3
packages/babel-plugin-jsx/jest.config.js
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module.exports = {
|
||||||
|
setupFiles: ['./test/setup.js'],
|
||||||
|
};
|
@ -13,7 +13,7 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "webpack-dev-server",
|
"dev": "webpack-dev-server",
|
||||||
"lint": "eslint --ext .js src",
|
"lint": "eslint --ext .js src",
|
||||||
"test": "jest --config .jest.js"
|
"test": "jest"
|
||||||
},
|
},
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/vueComponent/jsx/issues"
|
"url": "https://github.com/vueComponent/jsx/issues"
|
||||||
@ -30,6 +30,7 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.9.6",
|
"@babel/core": "^7.9.6",
|
||||||
"@babel/preset-env": "^7.9.6",
|
"@babel/preset-env": "^7.9.6",
|
||||||
|
"@vue/compiler-dom": "^3.0.0-beta.14",
|
||||||
"@vue/test-utils": "^2.0.0-alpha.6",
|
"@vue/test-utils": "^2.0.0-alpha.6",
|
||||||
"babel-jest": "^26.0.1",
|
"babel-jest": "^26.0.1",
|
||||||
"babel-loader": "^8.1.0",
|
"babel-loader": "^8.1.0",
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
const jsxInjectionPATH = 'PACKAGE/lib/jsxInjection';
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
mode: 'development',
|
mode: 'development',
|
||||||
devtool: 'cheap-module-eval-source-map',
|
devtool: 'cheap-module-eval-source-map',
|
||||||
@ -19,14 +17,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
resolve: {
|
|
||||||
alias: {
|
|
||||||
[jsxInjectionPATH]: path.resolve(
|
|
||||||
__dirname,
|
|
||||||
'./lib/jsxInjection',
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
devServer: {
|
devServer: {
|
||||||
inline: true,
|
inline: true,
|
||||||
open: true,
|
open: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user