Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Commit

Permalink
fix: examples eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
zoy-l committed Mar 9, 2021
1 parent 4ddf203 commit 3e2161b
Show file tree
Hide file tree
Showing 13 changed files with 31 additions and 18 deletions.
4 changes: 0 additions & 4 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
{
"files": ["examples/normal-react/*.tsx"],
"extends": ["zmi/react"]
},
{
"files": ["examples/normal-vue/*.tsx", "examples/normal-vue/*.vue"],
"extends": ["zmi/vue"]
}
]
}
5 changes: 5 additions & 0 deletions examples/normal-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@
"dependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1"
},
"eslintConfig": {
"extends": [
"zmi/react"
]
}
}
2 changes: 2 additions & 0 deletions examples/normal-react/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, { useState } from 'react'
import logo from './logo.svg'
import './app.less'

const b = 1

function App() {
const [count, setCount] = useState(1)

Expand Down
4 changes: 4 additions & 0 deletions examples/normal-vue/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"root": true,
"extends": ["zmi/vue"]
}
2 changes: 1 addition & 1 deletion examples/normal-vue/src/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { defineComponent } from 'vue'
export default defineComponent({
name: 'Home',
name: 'home',
data() {
return {
msg: 'hello vue 3'
Expand Down
2 changes: 0 additions & 2 deletions examples/normal-vue/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { createApp } from 'vue'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import App from './tsx'

createApp(App).mount('#root')
4 changes: 3 additions & 1 deletion examples/normal-vue/src/tsx.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ export default defineComponent({
<div class={hello.red}>
{this.tsx}
<div> {this.count}</div>

{/* {[1, 2].map((i) => {
return <div>{i}</div>
})} */}
<kda class={hello.tsx} />
</div>
)
Expand Down
6 changes: 6 additions & 0 deletions packages/zmi-webpack/fixtures/react-config/dist/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
;(() => {
'use strict'
const o = {}
var s = 1
console.log(s, o)
})()
3 changes: 3 additions & 0 deletions packages/zmi-webpack/fixtures/vue-config/dist/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
;(() => {
'use strict'
})()
2 changes: 1 addition & 1 deletion packages/zmi-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"css-minimizer-webpack-plugin": "^1.2.0",
"css-modules-typescript-loader": "^4.0.1",
"eslint": "^7.21.0",
"eslint-config-zmi": "^1.1.5",
"eslint-config-zmi": "^1.1.6",
"eslint-webpack-plugin": "^2.5.2",
"file-loader": "^6.2.0",
"fork-ts-checker-webpack-plugin": "^6.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/zmi-webpack/src/applyPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async function applyPlugin(options: IPenetrateOptions) {
context: cwd,
cwd,
cache: true,
useEslintrc: false,
// useEslintrc: false,
failOnError: isDev,
resolvePluginsRelativeTo: __dirname,
cacheLocation: path.join(cwd, 'node_modules/.cache/.eslintcache'),
Expand Down
5 changes: 1 addition & 4 deletions scripts/cleanModules.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ exec('lerna clean --ignore @zmi-cli/webpack --yes', (err, stdout, stderr) => {
console.log(stdout)
console.log(stderr)
// will cause webpack types errors
const webpackTypes = path.join(
__dirname,
'../packages/zmi-webpack/node_modules/@types'
)
const webpackTypes = path.join(__dirname, '../packages/zmi-webpack/node_modules/@types')
rimraf.sync(webpackTypes)
console.log(`clean removing ${webpackTypes}`)
}
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5564,10 +5564,10 @@ eslint-config-prettier@^8.1.0:
resolved "https://registry.npm.taobao.org/eslint-config-prettier/download/eslint-config-prettier-8.1.0.tgz?cache=0&sync_timestamp=1614187358311&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-config-prettier%2Fdownload%2Feslint-config-prettier-8.1.0.tgz#4ef1eaf97afe5176e6a75ddfb57c335121abc5a6"
integrity sha1-TvHq+Xr+UXbmp13ftXwzUSGrxaY=

eslint-config-zmi@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/eslint-config-zmi/-/eslint-config-zmi-1.1.5.tgz#84bb623be42a435de5efd4d7e1f57e3af5f1e588"
integrity sha512-zXhDMjK5+81ise6Gu+TX5OF0DkXamprzvTH9lASGRaQGaH0E+XLORJFnc3ZiwP08VNTYqVQRiVKNaImsHdK4nQ==
eslint-config-zmi@^1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/eslint-config-zmi/-/eslint-config-zmi-1.1.6.tgz#8df3930765d06a224bbd057c3b4073bbbf25b081"
integrity sha512-UkVb00F0a8O3tE8SIBraLlGbTbDZpqboqxshpPSCMNVwAz4v5cJsHCDqQniE37QWgkTD9HcpToici6IzA9C6Ug==
dependencies:
"@typescript-eslint/eslint-plugin" "^4.16.1"
"@typescript-eslint/parser" "^4.16.1"
Expand Down

0 comments on commit 3e2161b

Please sign in to comment.