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

Commit

Permalink
Adjust eslint configs (#1979)
Browse files Browse the repository at this point in the history
- Stop eslint ignoring sk config files and adjust gql config
- Allow gql config, but ignore fixture files
  • Loading branch information
BPScott authored Jul 29, 2021
1 parent 2fd0964 commit 25d95c9
Show file tree
Hide file tree
Showing 77 changed files with 92 additions and 80 deletions.
7 changes: 5 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ packages/*/build
**/*.js
**/*.esnext
**/*.mjs
**/sewing-kit.config.ts
config/sewing-kit/index.ts
**/test/fixtures/**/default-types/*.ts

# Don't lint fixture graphql files as they include schemas
packages/graphql-config-utilities/src/tests/fixtures/**/*.graphql
packages/graphql-typescript-definitions/test/fixtures/**/*.graphql
packages/graphql-validate-fixtures/test/fixtures/**/*.graphql
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module.exports = {
'plugin:@shopify/typescript',
'plugin:@shopify/typescript-type-checking',
'plugin:@shopify/react',
'plugin:@shopify/graphql',
'plugin:@shopify/jest',
'plugin:@shopify/prettier',
],
Expand Down Expand Up @@ -89,7 +90,11 @@ module.exports = {
},
},
{
files: ['packages/sewing-kit-plugin-quilt/src/*.ts'],
files: [
'**/sewing-kit.config.ts',
'config/sewing-kit/index.ts',
'packages/sewing-kit-plugin-quilt/src/*.ts',
],
rules: {
'babel/no-unused-expressions': 'off',
},
Expand Down
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ coverage
*.svg
templates/*.md
/README.md

# Deliberatly invalid code that prettier can not process
packages/graphql-validate-fixtures/test/fixtures/fixture-invalid/**/*.graphql
packages/graphql-validate-fixtures/test/fixtures/fixture-invalid/**/*.json
2 changes: 1 addition & 1 deletion packages/address-consts/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/address-mocks/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/address/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/admin-graphql-api-utilities/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/ast-utilities/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({name: 'javascript', root: './src/javascript'});
Expand Down
2 changes: 1 addition & 1 deletion packages/async/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({name: 'babel', root: './src/babel-plugin'});
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/csrf-token-fetcher/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/css-utilities/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/dates/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/decorators/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/function-enhancers/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-config-utilities/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-fixtures/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-mini-transforms/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({name: 'jest', root: './src/jest'});
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-persisted/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({name: 'koa', root: './src/koa-middleware'});
pkg.entry({name: 'apollo', root: './src/apollo'});
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-testing/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({name: 'matchers', root: './src/matchers'});
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-tool-utilities/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-typed/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.binary({name: 'graphql-typescript-definitions', root: './src/cli'});
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-validate-fixtures/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.binary({name: 'graphql-validate-fixtures', root: './src/cli'});
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-dom-mocks/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-koa-mocks/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/koa-liveness-ping/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/koa-metrics/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/koa-performance/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/koa-shopify-graphql-proxy/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/koa-shopify-webhooks/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/logger/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/mime-types/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/network/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
2 changes: 1 addition & 1 deletion packages/performance/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
4 changes: 2 additions & 2 deletions packages/polyfills/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {BabelConfig, updateBabelPreset} from '@sewing-kit/plugin-javascript';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});

Expand Down Expand Up @@ -61,7 +61,7 @@ export default createPackage(pkg => {
pkg.use(
createProjectBuildPlugin('Quilt.PackagePolyfillsBuild', ({hooks}) => {
hooks.target.hook(({hooks}) => {
hooks.configure.hook(hooks => {
hooks.configure.hook((hooks) => {
hooks.babelConfig?.hook(
updateBabelPreset(
[
Expand Down
2 changes: 1 addition & 1 deletion packages/predicates/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage({useReact: true}));
Expand Down
2 changes: 1 addition & 1 deletion packages/react-async/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.entry({name: 'testing', root: './src/testing'});
Expand Down
2 changes: 1 addition & 1 deletion packages/react-bugsnag/sewing-kit.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {createPackage, Runtime} from '@sewing-kit/config';

import {quiltPackage} from '../../config/sewing-kit';

export default createPackage(pkg => {
export default createPackage((pkg) => {
pkg.runtimes(Runtime.Browser, Runtime.Node);
pkg.entry({root: './src/index'});
pkg.use(quiltPackage({useReact: true}));
Expand Down
Loading

0 comments on commit 25d95c9

Please sign in to comment.