Skip to content

Commit 38c6a4d

Browse files
committed
add "import/extensions" eslint rule
1 parent 3216502 commit 38c6a4d

8 files changed

+203
-13
lines changed

js/.eslintrc.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ module.exports = {
1515
plugins: [
1616
'vue',
1717
],
18+
settings: {
19+
'import/resolver': 'webpack',
20+
},
1821
rules: {
1922
indent: ['error', 4, { SwitchCase: 1 }],
2023
'object-shorthand': ['error', 'never'],
2124
'func-names': ['error', 'never'],
2225
'no-param-reassign': 'off',
2326
'class-methods-use-this': 'off',
24-
'import/no-unresolved': 'off',
2527
'no-plusplus': 'off',
2628
'consistent-return': 'off',
2729
'no-nested-ternary': 'off',
2830
'default-case': 'off',
29-
'import/prefer-default-export': 'off',
3031
'no-console': ['error', { allow: ['warn', 'error'] }],
3132
'no-underscore-dangle': 'off',
3233
'max-len': 'off',
@@ -43,6 +44,13 @@ module.exports = {
4344
balanced: true,
4445
},
4546
}],
47+
'import/no-unresolved': 'off',
48+
'import/prefer-default-export': 'off',
49+
'import/extensions': ['error', 'always', {
50+
'': 'never',
51+
js: 'never',
52+
vue: 'never',
53+
}],
4654
'vue/html-indent': ['error', 4],
4755
'jsdoc/require-param': 'off',
4856
'jsdoc/require-param-description': 'off',

js/package-lock.json

Lines changed: 184 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"css-loader": "^6.7.1",
4242
"eslint": "^8.26.0",
4343
"eslint-config-airbnb-base": "^15.0.0",
44+
"eslint-import-resolver-webpack": "^0.13.2",
4445
"eslint-plugin-import": "^2.26.0",
4546
"eslint-plugin-jsdoc": "^39.3.25",
4647
"eslint-plugin-vue": "^9.6.0",

js/src/services/vue.service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class VueService {
8181
app.component('AtkItemSearch', asyncComponentFactory('AtkItemSearch', () => import(/* webpackChunkName: 'atk-vue-item-search' */'../vue-components/item-search.component')));
8282
app.component('AtkMultiline', asyncComponentFactory('AtkMultiline', () => import(/* webpackChunkName: 'atk-vue-multiline' */'../vue-components/multiline/multiline.component')));
8383
app.component('AtkTreeItemSelector', asyncComponentFactory('AtkTreeItemSelector', () => import(/* webpackChunkName: 'atk-vue-tree-item-selector' */'../vue-components/tree-item-selector/tree-item-selector.component')));
84-
app.component('AtkQueryBuilder', asyncComponentFactory('AtkQueryBuilder', () => import(/* webpackChunkName: 'atk-vue-query-builder' */'../vue-components/query-builder/query-builder.component.vue')));
84+
app.component('AtkQueryBuilder', asyncComponentFactory('AtkQueryBuilder', () => import(/* webpackChunkName: 'atk-vue-query-builder' */'../vue-components/query-builder/query-builder.component')));
8585
}
8686

8787
/**

js/src/vue-components/query-builder/fomantic-ui-group.component.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
</template>
7777

7878
<script>
79-
import VueQueryBuilderGroup from 'vue-query-builder/src/components/QueryBuilderGroup.vue';
79+
import VueQueryBuilderGroup from 'vue-query-builder/src/components/QueryBuilderGroup';
8080
8181
export default {
8282
name: 'QueryBuilderGroup',

js/src/vue-components/query-builder/fomantic-ui-rule.component.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
</template>
121121

122122
<script>
123-
import VueQueryBuilderRule from 'vue-query-builder/src/components/QueryBuilderRule.vue';
123+
import VueQueryBuilderRule from 'vue-query-builder/src/components/QueryBuilderRule';
124124
import AtkDatePicker from '../share/atk-date-picker';
125125
import AtkLookup from '../share/atk-lookup';
126126

js/src/vue-components/query-builder/query-builder.component.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
</template>
3030

3131
<script>
32-
import VueQueryBuilder from 'vue-query-builder/src/VueQueryBuilder.vue';
33-
import QueryBuilderGroup from './fomantic-ui-group.component.vue';
34-
import QueryBuilderRule from './fomantic-ui-rule.component.vue';
32+
import VueQueryBuilder from 'vue-query-builder/src/VueQueryBuilder';
33+
import QueryBuilderGroup from './fomantic-ui-group.component';
34+
import QueryBuilderRule from './fomantic-ui-rule.component';
3535
3636
export default {
3737
name: 'QueryBuilder',

js/webpack.config.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const TerserPlugin = require('terser-webpack-plugin');
55
const VueFomanticUi = require('vue-fomantic-ui');
66

77
module.exports = (env) => {
8-
const isProduction = env.production;
8+
const isProduction = env === undefined ? false /* for eslint-import-resolver-webpack */ : env.production;
99
const srcDir = path.resolve(__dirname, './src');
1010
const publicDir = path.resolve(__dirname, '../public');
1111
const libraryName = 'atk';
@@ -97,10 +97,7 @@ module.exports = (env) => {
9797
srcDir,
9898
'node_modules',
9999
],
100-
extensions: [
101-
'.js',
102-
'.vue',
103-
],
100+
extensions: ['.js', '.vue'],
104101
},
105102
plugins: [
106103
new webpack.DefinePlugin({

0 commit comments

Comments
 (0)