Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Update prettier config (#943)
Browse files Browse the repository at this point in the history
  • Loading branch information
beeequeue authored Mar 16, 2021
1 parent b0ba7e7 commit c6d3ec5
Show file tree
Hide file tree
Showing 106 changed files with 908 additions and 1,516 deletions.
49 changes: 23 additions & 26 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,49 @@ module.exports = {
node: true,
},
extends: [
'plugin:vue/recommended',
'plugin:vue/vue3-recommended',
'@vue/prettier',
'@vue/typescript',
"plugin:vue/recommended",
"plugin:vue/vue3-recommended",
"@vue/prettier",
"@vue/typescript",
],
rules: {
'no-console': 'error',
'no-debugger': 'error',
'prettier/prettier': 'off',
'no-extra-boolean-cast': 'off',
'vue/no-v-html': 'off',
"no-console": "error",
"no-debugger": "error",
"prettier/prettier": "off",
"no-extra-boolean-cast": "off",
"vue/no-v-html": "off",
// good to have
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/await-thenable': 'error',
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/await-thenable": "error",
// consistency
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/consistent-type-assertions': [
'error',
{ assertionStyle: 'as' },
],
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
// vue 3 only
'vue/no-deprecated-v-on-native-modifier': 'off',
'vue/require-explicit-emits': 'off',
"vue/no-deprecated-v-on-native-modifier": "off",
"vue/require-explicit-emits": "off",
},
ignorePatterns: ['jest.*.ts'],
ignorePatterns: ["jest.*.ts"],
overrides: [
{
files: '*.js',
files: "*.js",
rules: {
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
'@typescript-eslint/await-thenable': 'off',
"@typescript-eslint/prefer-string-starts-ends-with": "off",
"@typescript-eslint/await-thenable": "off",
},
parserOptions: {
parser: 'babel-eslint',
parser: "babel-eslint",
},
},
{
files: ['src/**/*.test.ts'],
files: ["src/**/*.test.ts"],
env: {
jest: true,
},
},
],
parserOptions: {
parser: '@typescript-eslint/parser',
parser: "@typescript-eslint/parser",
warnOnUnsupportedTypeScriptVersion: false,
project: './tsconfig.json',
project: "./tsconfig.json",
},
}
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"semi": false,
"trailingComma": "all"
"trailingComma": "all",
"printWidth": 90
}
6 changes: 3 additions & 3 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
presets: ['@vue/cli-plugin-babel/preset'],
presets: ["@vue/cli-plugin-babel/preset"],
plugins: [
'@babel/plugin-proposal-optional-chaining',
'@babel/plugin-proposal-nullish-coalescing-operator',
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-proposal-nullish-coalescing-operator",
],
}
2 changes: 1 addition & 1 deletion codegen-schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ generates:
schema.graphql:
plugins:
- add:
content: '# THIS IS A GENERATED FILE'
content: "# THIS IS A GENERATED FILE"
- schema-ast
16 changes: 8 additions & 8 deletions codegen.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
overwrite: true

schema:
- 'https://graphql.anilist.co'
- 'src/graphql/client-schema.graphqls'
- "https://graphql.anilist.co"
- "src/graphql/client-schema.graphqls"

documents:
- 'src/**/*.{graphql,ts}'
- '!**/*.d.ts'
- "src/**/*.{graphql,ts}"
- "!**/*.d.ts"

config:
avoidOptionals: true
Expand All @@ -20,9 +20,9 @@ generates:
src/graphql/generated/types.ts:
plugins:
- add:
content: '/* THIS IS A GENERATED FILE */'
content: "/* THIS IS A GENERATED FILE */"
- add:
content: '/* eslint-disable */'
content: "/* eslint-disable */"
- typescript
- typescript-operations
- typescript-compatibility
Expand All @@ -32,9 +32,9 @@ generates:
src/graphql/generated/introspection-result.ts:
plugins:
- add:
content: '/* THIS IS A GENERATED FILE */'
content: "/* THIS IS A GENERATED FILE */"
- add:
content: '/* eslint-disable */'
content: "/* eslint-disable */"
- fragment-matcher
config:
apolloClientVersion: 2
10 changes: 5 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = {
preset: '@vue/cli-plugin-unit-jest/presets/typescript-and-babel',
testMatch: ['**/src/**/*.test.ts'],
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts', 'jest-localstorage-mock'],
preset: "@vue/cli-plugin-unit-jest/presets/typescript-and-babel",
testMatch: ["**/src/**/*.test.ts"],
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts", "jest-localstorage-mock"],
transform: {
'\\.(gql|graphql)$': 'jest-transform-graphql',
'\\.vue$': './vue-transform-root-store.js',
"\\.(gql|graphql)$": "jest-transform-graphql",
"\\.vue$": "./vue-transform-root-store.js",
},
}
16 changes: 8 additions & 8 deletions jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import Vue from 'vue'
import Vuex from 'vuex'
import Router from 'vue-router'
import Composition from '@vue/composition-api'
import Tooltip from 'v-tooltip'
import '@testing-library/jest-dom'
import Vue from "vue"
import Vuex from "vuex"
import Router from "vue-router"
import Composition from "@vue/composition-api"
import Tooltip from "v-tooltip"
import "@testing-library/jest-dom"

import './src/testing/mock-electron'
import './src/testing/mock-store'
import "./src/testing/mock-electron"
import "./src/testing/mock-store"

Vue.use(Vuex)
Vue.use(Router)
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@
"eslint-plugin-prettier": "3.3.0",
"eslint-plugin-vue": "7.2.0",
"graphql-tag": "2.11.0",
"husky": "4.3.6",
"husky": "4.3.8",
"jest-localstorage-mock": "2.4.7",
"jest-transform-graphql": "2.1.0",
"lint-staged": "10.5.3",
"lint-staged": "10.5.4",
"nock": "13.0.5",
"prettier": "2.2.1",
"raw-loader": "4.0.2",
Expand Down
Loading

0 comments on commit c6d3ec5

Please sign in to comment.