Skip to content

Commit

Permalink
build(js): change ts syntax & rollup babel config
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomchan-cxj committed Jan 14, 2022
1 parent 9d21e57 commit 9e7fb70
Show file tree
Hide file tree
Showing 39 changed files with 27,176 additions and 32,210 deletions.
48 changes: 47 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
const path = require('path');

function resolveVue(p) {
return path.resolve(__dirname, './node_modules/vue/src/', p);
}

function resolvePackage(src, extra = 'src') {
return path.resolve(__dirname, './packages/', src, extra);
}

module.exports = {
parser: 'vue-eslint-parser',
parserOptions: {
Expand Down Expand Up @@ -33,6 +43,22 @@ module.exports = {
// Note you must disable the base rule as it can report incorrect errors
'no-unused-vars': 'off',
'@typescript-eslint/explicit-member-accessibility': ['error'],
'@typescript-eslint/member-ordering': ['error'],
'@typescript-eslint/adjacent-overload-signatures': ['error'],
'@typescript-eslint/unified-signatures': ['error'],
'@typescript-eslint/consistent-type-assertions': ['error'],
'@typescript-eslint/no-inferrable-types': ['error'],
'@typescript-eslint/typedef': ['error'],
'@typescript-eslint/prefer-function-type': ['error'],
'@typescript-eslint/no-parameter-properties': ['error'],
'@typescript-eslint/no-namespace': ['error'],
'@typescript-eslint/prefer-namespace-keyword': ['error'],
'@typescript-eslint/no-non-null-asserted-optional-chain': ['error'],
'@typescript-eslint/no-unused-expressions': ['error'],
'@typescript-eslint/triple-slash-reference': ['error'],
'@typescript-eslint/type-annotation-spacing': ['error'],
'@typescript-eslint/method-signature-style': ['error'],
'@typescript-eslint/consistent-type-definitions': ['error'],
},
},
],
Expand All @@ -42,7 +68,7 @@ module.exports = {
es6: true,
},
globals: {
__PLATFORM__: 'readonly',
__PLATFORM__: 'writable',
__GLOBAL__: 'writable',
Hippy: 'writable',
WebSocket: 'writable',
Expand Down Expand Up @@ -114,5 +140,25 @@ module.exports = {
react: {
version: 'detect', // React version. "detect" automatically picks the version you have installed.
},
'import/ignore': [resolveVue('/')],
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', 'd.ts'],
},
alias: {
map: [
['@vue', resolvePackage('hippy-vue')],
['@router', resolvePackage('hippy-vue-router')],
['@css-loader', resolvePackage('hippy-vue-css-loader')],
['@native-components', resolvePackage('hippy-vue-native-components')],
['vue', resolveVue('core/index')],
['web', resolveVue('platforms/web')],
['core', resolveVue('core')],
['shared', resolveVue('shared')],
['sfc', resolveVue('sfc')],
['he', path.resolve(__dirname, './packages/hippy-vue/src/util/entity-decoder')],
],
},
},
},
};
6 changes: 3 additions & 3 deletions examples/android-demo/res/vendor.android.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
printTurboConfig,
nativeWithPromise,
getArray,
} from '@/components/demos/demoTurbo';
} from './demoTurbo';
export default {
data() {
Expand Down
6 changes: 3 additions & 3 deletions examples/ios-demo/res/vendor.ios.js

Large diffs are not rendered by default.

Loading

0 comments on commit 9e7fb70

Please sign in to comment.