Skip to content

Commit

Permalink
chore: add prettier and lint ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
mirages committed Dec 18, 2020
1 parent aee2e3d commit 865fec1
Show file tree
Hide file tree
Showing 17 changed files with 358 additions and 391 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
libs/*/types
3 changes: 2 additions & 1 deletion libs/motion/examples/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ <h4>水平移动</h4>
<div class="demo red" id="demox">x</div>
<h4>垂直移动</h4>
<div class="demo yellow" id="demoy">y</div>
<script src="../dist/motion.umd.js"></script>
<script src="../dist/index.umd.js"></script>
<script>
var Motion = window['@whee/js-motion']
var Direction = Motion.Direction
var Mode = Motion.Mode
var $target = document.querySelector('#target')
Expand Down
146 changes: 71 additions & 75 deletions libs/motion/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions libs/motion/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"clean": "rimraf dist && rimraf types",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"lint:ts": "eslint --f codeframe {src,test}/**",
"test": "karma start",
"test": "karma start --single-run --browsers ChromeHeadless",
"build": "npm run clean && rollup -c",
"pub": "sh scripts/release.sh"
},
Expand Down Expand Up @@ -51,8 +51,8 @@
"karma-typescript": "^5.2.0",
"mocha": "^8.1.3",
"rollup": "^2.26.10",
"rollup-plugin-banner": "^0.2.1",
"rollup-plugin-uglify": "^6.0.4",
"rollup-plugin-terser": "^7.0.2",
"tslib": "^2.0.1"
}
},
"eslintIgnore": ["types"]
}
34 changes: 24 additions & 10 deletions libs/motion/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { nodeResolve } from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import typescript from '@rollup/plugin-typescript'
import { uglify } from 'rollup-plugin-uglify'
import banner from 'rollup-plugin-banner'
import { terser } from 'rollup-plugin-terser'

const pkg = require('./package.json')
const banner = `
/*!
* ${pkg.name}
* v${pkg.version}
* by ${pkg.author}
*/
`

export default {
input: 'src/index.ts',
Expand All @@ -15,17 +21,14 @@ export default {
dir: "./",
entryFileNames: 'dist/[name].umd.js',
format: 'umd',
name: 'Motion',
plugins: [
uglify({
mangle: true
})
]
name: pkg.name,
banner
},
{
dir: "./",
entryFileNames: 'dist/[name].esm.js',
format: 'es'
format: 'es',
banner
}
],
plugins: [
Expand All @@ -40,6 +43,17 @@ export default {
declarationDir: 'types/',
rootDir: 'src/'
}),
banner(`${pkg.name}\nv${pkg.version}\nby ${pkg.author}`)
terser({
output: {
comments: (node, comment) => {
const text = comment.value
const type = comment.type
if (type == 'comment2') {
// multiline comment
return /^!/.test(text) && !/Copyright/.test(text)
}
}
}
})
]
}
6 changes: 3 additions & 3 deletions libs/picker/examples/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
<script src="../dist/factory/simple.umd.js"></script>
<script src="../dist/factory/datetime.umd.js"></script>
<script>
var { Picker, Scroller } = window['scroller-picker']
var { SimpleDataSourceFactory, CascadeDataSourceFactory } = window['scroller-picker/factory/simple']
var { DatetimeDataSourceFactory } = window['scroller-picker/factory/datetime']
var { Picker, Scroller } = window['@whee/js-picker']
var { SimpleDataSourceFactory, CascadeDataSourceFactory } = window['@whee/js-picker/factory/simple']
var { DatetimeDataSourceFactory } = window['@whee/js-picker/factory/datetime']
var dataList = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
var cascadeData = [
{
Expand Down
7 changes: 4 additions & 3 deletions libs/picker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"clean": "rimraf dist && rimraf types",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"lint:ts": "eslint --f codeframe {src,test,plugins}/**/*.ts karma.conf.ts",
"lint:css": "stylelint **/*.{css,less,scss}",
"test": "karma start",
"lint:css": "stylelint src/**/*.{css,less,scss}",
"test": "karma start --single-run --browsers ChromeHeadless",
"build": "npm run clean && rollup -c"
},
"repository": {
Expand Down Expand Up @@ -67,5 +67,6 @@
},
"dependencies": {
"@whee/js-motion": "^1.1.0"
}
},
"eslintIgnore": ["types"]
}
2 changes: 1 addition & 1 deletion libs/picker/src/factory/simple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class SimpleDataSource<T extends SimpleData>
}

getInit(): Indexable<T> {
return this.createData(this.initIndex)!
return this.createData(this.initIndex)! // eslint-disable-line
}

getPrev(data: Nullable<Indexable<T>>): Nullable<Indexable<T>> {
Expand Down
Loading

0 comments on commit 865fec1

Please sign in to comment.