Skip to content

Commit

Permalink
Merge pull request #3759 from LibreSign/chore/update-eslint-rules
Browse files Browse the repository at this point in the history
Chore/update eslint rules
  • Loading branch information
vitormattos authored Sep 23, 2024
2 parents a570c13 + 5239bce commit 97335b6
Show file tree
Hide file tree
Showing 74 changed files with 439 additions and 242 deletions.
52 changes: 52 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,58 @@ module.exports = {
// production only
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'vue/no-unused-components': process.env.NODE_ENV === 'production' ? 'error' : 'warn',
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', ['parent', 'sibling', 'index'], 'unknown'],
pathGroups: [
{
// group all style imports at the end
pattern: '{*.css,*.scss}',
patternOptions: { matchBase: true },
group: 'unknown',
position: 'after',
},
{
// group material design icons
pattern: 'vue-material-design-icons/**',
group: 'external',
position: 'after',
},
{
// group @nextcloud imports
pattern: '@nextcloud/{!(vue),!(vue)/**}',
group: 'external',
position: 'after',
},
{
// group @nextcloud/vue imports
pattern: '{@nextcloud/vue,@nextcloud/vue/**}',
group: 'external',
position: 'after',
},
{
// group project components
pattern: '*.vue',
patternOptions: { matchBase: true },
group: 'parent',
position: 'before',
},
],
pathGroupsExcludedImportTypes: ['@nextcloud', 'vue-material-design-icons'],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
warnOnUnassignedImports: true,
},
],
'import/no-unresolved': ['error', {
// Ignore Webpack query parameters, not supported by eslint-plugin-import
// https://github.com/import-js/eslint-plugin-import/issues/2562
ignore: ['\\?raw$'],
}],
},
overrides: [
{
Expand Down
6 changes: 4 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@
</template>

<script>
import NcContent from '@nextcloud/vue/dist/Components/NcContent.js'
import NcAppContent from '@nextcloud/vue/dist/Components/NcAppContent.js'
import NcContent from '@nextcloud/vue/dist/Components/NcContent.js'
import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js'
import LogoLibreSign from './../img/logo-gray.svg'
import LeftSidebar from './Components/LeftSidebar/LeftSidebar.vue'
import RightSidebar from './Components/RightSidebar/RightSidebar.vue'
import LogoLibreSign from './../img/logo-gray.svg'
export default {
name: 'App',
components: {
Expand Down
13 changes: 8 additions & 5 deletions src/Components/Draw/Draw.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,18 @@
</template>

<script>
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import DrawIcon from 'vue-material-design-icons/Draw.vue'
import SignatureTextIcon from 'vue-material-design-icons/SignatureText.vue'
import UploadIcon from 'vue-material-design-icons/Upload.vue'
import NcAppSidebar from '@nextcloud/vue/dist/Components/NcAppSidebar.js'
import NcAppSidebarTab from '@nextcloud/vue/dist/Components/NcAppSidebarTab.js'
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import Editor from './Editor.vue'
import DrawIcon from 'vue-material-design-icons/Draw.vue'
import TextInput from './TextInput.vue'
import SignatureTextIcon from 'vue-material-design-icons/SignatureText.vue'
import FileUpload from './FileUpload.vue'
import UploadIcon from 'vue-material-design-icons/Upload.vue'
import TextInput from './TextInput.vue'
import { useSignatureElementsStore } from '../../store/signatureElements.js'
export default {
Expand Down
12 changes: 8 additions & 4 deletions src/Components/Draw/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,17 @@
</template>

<script>
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import NcColorPicker from '@nextcloud/vue/dist/Components/NcColorPicker.js'
import PaletteIcon from 'vue-material-design-icons/Palette.vue'
import { VPerfectSignature } from 'v-perfect-signature'
import DeleteIcon from 'vue-material-design-icons/Delete.vue'
import PaletteIcon from 'vue-material-design-icons/Palette.vue'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcColorPicker from '@nextcloud/vue/dist/Components/NcColorPicker.js'
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import PreviewSignature from '../PreviewSignature/PreviewSignature.vue'
import { VPerfectSignature } from 'v-perfect-signature'
import { SignatureImageDimensions } from './options.js'
export default {
Expand Down
12 changes: 8 additions & 4 deletions src/Components/Draw/FileUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,16 @@
</template>

<script>
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import { isEmpty } from 'lodash-es'
import { Cropper } from 'vue-advanced-cropper'
import 'vue-advanced-cropper/dist/style.css'
import { SignatureImageDimensions } from './options.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import { isEmpty } from 'lodash-es'
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import { SignatureImageDimensions } from './options.js'
import 'vue-advanced-cropper/dist/style.css'
export default {
name: 'FileUpload',
components: {
Expand Down
10 changes: 6 additions & 4 deletions src/Components/Draw/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
</template>

<script>
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import '@fontsource/dancing-script'
import { SignatureImageDimensions } from './options.js'
import { isEmpty } from 'lodash-es'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import { SignatureImageDimensions } from './options.js'
export default {
name: 'TextInput',
components: {
Expand Down
2 changes: 2 additions & 0 deletions src/Components/File/File.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@

<script>
import FileIcon from 'vue-material-design-icons/File.vue'
import { generateUrl, generateOcsUrl } from '@nextcloud/router'
import { useFilesStore } from '../../store/files.js'
export default {
Expand Down
16 changes: 10 additions & 6 deletions src/Components/LeftSidebar/LeftSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,22 @@
</template>

<script>
import NcAppNavigation from '@nextcloud/vue/dist/Components/NcAppNavigation.js'
import NcAppNavigationItem from '@nextcloud/vue/dist/Components/NcAppNavigationItem.js'
import NcAppNavigationSettings from '@nextcloud/vue/dist/Components/NcAppNavigationSettings.js'
import { getCurrentUser } from '@nextcloud/auth'
import { loadState } from '@nextcloud/initial-state'
import { useFilesStore } from '../../store/files.js'
import AccountCheckIcon from 'vue-material-design-icons/AccountCheck.vue'
import FileCheckIcon from 'vue-material-design-icons/FileCheck.vue'
import FileSignIcon from 'vue-material-design-icons/FileSign.vue'
import FolderIcon from 'vue-material-design-icons/Folder.vue'
import { getCurrentUser } from '@nextcloud/auth'
import { loadState } from '@nextcloud/initial-state'
import NcAppNavigation from '@nextcloud/vue/dist/Components/NcAppNavigation.js'
import NcAppNavigationItem from '@nextcloud/vue/dist/Components/NcAppNavigationItem.js'
import NcAppNavigationSettings from '@nextcloud/vue/dist/Components/NcAppNavigationSettings.js'
import CroppedLayoutSettings from '../Settings/CroppedLayoutSettings.vue'
import { useFilesStore } from '../../store/files.js'
export default {
name: 'LeftSidebar',
components: {
Expand Down
1 change: 1 addition & 0 deletions src/Components/PdfEditor/PdfEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

<script>
import VuePdfEditor from '@libresign/vue-pdf-editor'
import Signature from './Signature.vue'
export default {
Expand Down
3 changes: 2 additions & 1 deletion src/Components/PdfEditor/Signature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@
</template>

<script>
import itemEventsMixin from '@libresign/vue-pdf-editor/src/Components/ItemEventsMixin.vue'
import CloseCircleIcon from 'vue-material-design-icons/CloseCircle.vue'
import itemEventsMixin from '@libresign/vue-pdf-editor/src/Components/ItemEventsMixin.vue'
export default {
name: 'Signature',
components: {
Expand Down
3 changes: 2 additions & 1 deletion src/Components/PreviewSignature/PreviewSignature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
</template>

<script>
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
import axios from '@nextcloud/axios'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
export default {
name: 'PreviewSignature',
components: {
Expand Down
6 changes: 4 additions & 2 deletions src/Components/Request/AccountOrEmail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
</div>
</template>
<script>
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
import AlertCircle from 'vue-material-design-icons/AlertCircleOutline.vue'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
import AlertCircle from 'vue-material-design-icons/AlertCircleOutline.vue'
import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js'
export default {
name: 'AccountOrEmail',
Expand Down
7 changes: 5 additions & 2 deletions src/Components/Request/IdentifySigner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,13 @@
</div>
</template>
<script>
import { loadState } from '@nextcloud/initial-state'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import AccountOrEmail from './AccountOrEmail.vue'
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import { loadState } from '@nextcloud/initial-state'
import AccountOrEmail from './AccountOrEmail.vue'
import { useFilesStore } from '../../store/files.js'
export default {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
</template>

<script>
import NcCounterBubble from '@nextcloud/vue/dist/Components/NcCounterBubble.js'
import { size } from 'lodash-es'
import NcCounterBubble from '@nextcloud/vue/dist/Components/NcCounterBubble.js'
export default {
name: 'PageNavigation',
components: { NcCounterBubble },
Expand Down
7 changes: 4 additions & 3 deletions src/Components/Request/SignDetail/partials/SignerRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
</template>

<script>
import NcListItem from '@nextcloud/vue/dist/Components/NcListItem.js'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import Moment from '@nextcloud/moment'
import { emit } from '@nextcloud/event-bus'
import Moment from '@nextcloud/moment'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcListItem from '@nextcloud/vue/dist/Components/NcListItem.js'
export default {
name: 'SignerRow',
Expand Down
21 changes: 12 additions & 9 deletions src/Components/Request/VisibleElements.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,24 @@
</template>

<script>
import { showSuccess } from '@nextcloud/dialogs'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
import { showSuccess } from '@nextcloud/dialogs'
import { subscribe, unsubscribe, emit } from '@nextcloud/event-bus'
import { loadState } from '@nextcloud/initial-state'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import { generateOcsUrl } from '@nextcloud/router'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import { subscribe, unsubscribe, emit } from '@nextcloud/event-bus'
import { SIGN_STATUS } from '../../domains/sign/enum.js'
import Signer from '../Signers/Signer.vue'
import { SignatureImageDimensions } from '../Draw/options.js'
import Chip from '../Chip.vue'
import NcDialog from '@nextcloud/vue/dist/Components/NcDialog.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
import NcNoteCard from '@nextcloud/vue/dist/Components/NcNoteCard.js'
import Chip from '../Chip.vue'
import PdfEditor from '../PdfEditor/PdfEditor.vue'
import Signer from '../Signers/Signer.vue'
import { SIGN_STATUS } from '../../domains/sign/enum.js'
import { useFilesStore } from '../../store/files.js'
import { SignatureImageDimensions } from '../Draw/options.js'
export default {
name: 'VisibleElements',
Expand Down
1 change: 1 addition & 0 deletions src/Components/RightSidebar/AppFilesTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

<script>
import RequestSignatureTab from '../RightSidebar/RequestSignatureTab.vue'
import { useFilesStore } from '../../store/files.js'
export default {
Expand Down
20 changes: 12 additions & 8 deletions src/Components/RightSidebar/RequestSignatureTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,28 @@
</div>
</template>
<script>
import Delete from 'vue-material-design-icons/Delete.vue'
import { getCurrentUser } from '@nextcloud/auth'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'
import { showError, showSuccess } from '@nextcloud/dialogs'
import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus'
import { loadState } from '@nextcloud/initial-state'
import { generateOcsUrl } from '@nextcloud/router'
import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'
import NcModal from '@nextcloud/vue/dist/Components/NcModal.js'
import { getCurrentUser } from '@nextcloud/auth'
import Delete from 'vue-material-design-icons/Delete.vue'
import { showError, showSuccess } from '@nextcloud/dialogs'
import Signers from '../Signers/Signers.vue'
import IdentifySigner from '../Request/IdentifySigner.vue'
import VisibleElements from '../Request/VisibleElements.vue'
import { loadState } from '@nextcloud/initial-state'
import Signers from '../Signers/Signers.vue'
import router from '../../router/router.js'
import { useFilesStore } from '../../store/files.js'
import { useSignStore } from '../../store/sign.js'
import { useSidebarStore } from '../../store/sidebar.js'
import router from '../../router/router.js'
import { useSignStore } from '../../store/sign.js'
export default {
name: 'RequestSignatureTab',
Expand Down
4 changes: 3 additions & 1 deletion src/Components/RightSidebar/RightSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@
<script>
import NcAppSidebar from '@nextcloud/vue/dist/Components/NcAppSidebar.js'
import NcAppSidebarTab from '@nextcloud/vue/dist/Components/NcAppSidebarTab.js'
import RequestSignatureTab from '../RightSidebar/RequestSignatureTab.vue'
import SignTab from '../RightSidebar/SignTab.vue'
import { useFilesStore } from '../../store/files.js'
import { useSignStore } from '../../store/sign.js'
import { useSidebarStore } from '../../store/sidebar.js'
import { useSignStore } from '../../store/sign.js'
export default {
name: 'RightSidebar',
Expand Down
Loading

0 comments on commit 97335b6

Please sign in to comment.