Skip to content

Commit

Permalink
Merge pull request #338 from CivicDataLab/CU-86cuthx9g_Refactor-OPub-…
Browse files Browse the repository at this point in the history
…Mono_Shoaib-Ahmed

Cu 86cuthx9g refactor o pub mono shoaib ahmed
  • Loading branch information
PixeledCode authored Mar 8, 2024
2 parents 8935d41 + 91e2949 commit a88de7b
Show file tree
Hide file tree
Showing 23 changed files with 321 additions and 114 deletions.
20 changes: 20 additions & 0 deletions examples/data-exchange/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'next',
'prettier',
],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/no-explicit-any': ['off'],
'react/display-name': 'off',
'@next/next/no-html-link-for-pages': 'off',
'prefer-const': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@next/next/no-img-element': 'off',
},
ignorePatterns: ['**/generated/**/*.ts', 'node_modules/', 'dist/'],
}
4 changes: 0 additions & 4 deletions examples/data-exchange/.eslintrc.json

This file was deleted.

33 changes: 33 additions & 0 deletions examples/data-exchange/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
endOfLine: 'lf',
semi: true,
trailingComma: 'es5',
printWidth: 80,
tabWidth: 2,
useTabs: false,
singleQuote: true,
importOrder: [
'^(react/(.*)$)|^(react$)',
'^(next/(.*)$)|^(next$)',
'<THIRD_PARTY_MODULES>',
'',
'^types$',
'^@local/(.*)$',
'^@/config/(.*)$',
'^@/lib/(.*)$',
'^@/components/(.*)$',
'^@/styles/(.*)$',
'^[./]',
],
importOrderSeparation: false,
importOrderSortSpecifiers: true,
importOrderBuiltinModulesToTop: true,
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
importOrderMergeDuplicateImports: true,
importOrderCombineTypeAndValueImports: true,
plugins: [
'@ianvs/prettier-plugin-sort-imports',
'prettier-plugin-tailwindcss',
],
tailwindFunctions: ['clsx', 'cn'],
};
1 change: 0 additions & 1 deletion examples/data-exchange/.prettierrc.json

This file was deleted.

56 changes: 28 additions & 28 deletions examples/data-exchange/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"compilerOptions": {
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"downlevelIteration": true,
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "ESNext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules", "gql"]
"compilerOptions": {
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"downlevelIteration": true,
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "ESNext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
20 changes: 20 additions & 0 deletions examples/district/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'next',
'prettier',
],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/no-explicit-any': ['off'],
'react/display-name': 'off',
'@next/next/no-html-link-for-pages': 'off',
'prefer-const': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@next/next/no-img-element': 'off',
},
ignorePatterns: ['**/generated/**/*.ts', 'node_modules/', 'dist/'],
}
4 changes: 0 additions & 4 deletions examples/district/.eslintrc.json

This file was deleted.

33 changes: 33 additions & 0 deletions examples/district/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
endOfLine: 'lf',
semi: true,
trailingComma: 'es5',
printWidth: 80,
tabWidth: 2,
useTabs: false,
singleQuote: true,
importOrder: [
'^(react/(.*)$)|^(react$)',
'^(next/(.*)$)|^(next$)',
'<THIRD_PARTY_MODULES>',
'',
'^types$',
'^@local/(.*)$',
'^@/config/(.*)$',
'^@/lib/(.*)$',
'^@/components/(.*)$',
'^@/styles/(.*)$',
'^[./]',
],
importOrderSeparation: false,
importOrderSortSpecifiers: true,
importOrderBuiltinModulesToTop: true,
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
importOrderMergeDuplicateImports: true,
importOrderCombineTypeAndValueImports: true,
plugins: [
'@ianvs/prettier-plugin-sort-imports',
'prettier-plugin-tailwindcss',
],
tailwindFunctions: ['clsx', 'cn'],
};
1 change: 0 additions & 1 deletion examples/district/.prettierrc.json

This file was deleted.

48 changes: 28 additions & 20 deletions examples/district/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
{
"extends": "@repo/config-ts/example.json",
"compilerOptions": {
"plugins": [
{
"name": "next"
}
],
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
},
"include": [
"next-env.d.ts",
"next.config.js",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": ["node_modules"]
"compilerOptions": {
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"downlevelIteration": true,
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "ESNext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
20 changes: 20 additions & 0 deletions examples/drr/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'next',
'prettier',
],
rules: {
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['warn'],
'@typescript-eslint/no-explicit-any': ['off'],
'react/display-name': 'off',
'@next/next/no-html-link-for-pages': 'off',
'prefer-const': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@next/next/no-img-element': 'off',
},
ignorePatterns: ['**/generated/**/*.ts', 'node_modules/', 'dist/'],
}
4 changes: 0 additions & 4 deletions examples/drr/.eslintrc.json

This file was deleted.

33 changes: 33 additions & 0 deletions examples/drr/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
endOfLine: 'lf',
semi: true,
trailingComma: 'es5',
printWidth: 80,
tabWidth: 2,
useTabs: false,
singleQuote: true,
importOrder: [
'^(react/(.*)$)|^(react$)',
'^(next/(.*)$)|^(next$)',
'<THIRD_PARTY_MODULES>',
'',
'^types$',
'^@local/(.*)$',
'^@/config/(.*)$',
'^@/lib/(.*)$',
'^@/components/(.*)$',
'^@/styles/(.*)$',
'^[./]',
],
importOrderSeparation: false,
importOrderSortSpecifiers: true,
importOrderBuiltinModulesToTop: true,
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
importOrderMergeDuplicateImports: true,
importOrderCombineTypeAndValueImports: true,
plugins: [
'@ianvs/prettier-plugin-sort-imports',
'prettier-plugin-tailwindcss',
],
tailwindFunctions: ['clsx', 'cn'],
};
1 change: 0 additions & 1 deletion examples/drr/.prettierrc.json

This file was deleted.

15 changes: 6 additions & 9 deletions examples/drr/lib/api.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { gqlConfig } from '@/config/site';
import React from 'react';
import { type TypedDocumentNode } from '@graphql-typed-document-node/core';
import { QueryClient, useQuery } from '@tanstack/react-query';
import { request } from 'graphql-request';
import React from 'react';

import { gqlConfig } from '@/config/site';

// create a wrapper function for graphql-request
// that will be used by react-query
Expand All @@ -11,13 +12,9 @@ export async function GraphQL<TResult, TVariables>(
document: TypedDocumentNode<TResult, TVariables>,
...[variables]: TVariables extends Record<string, never> ? [] : [TVariables]
) {
const data = await request(
gqlConfig[type],
document,
{
...variables,
},
);
const data = await request(gqlConfig[type], document, {
...variables,
});
return data;
}

Expand Down
56 changes: 28 additions & 28 deletions examples/drr/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"compilerOptions": {
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"downlevelIteration": true,
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "ESNext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"compilerOptions": {
"target": "ESNext",
"lib": ["dom", "dom.iterable", "esnext"],
"downlevelIteration": true,
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "ESNext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [
{
"name": "next"
}
],
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
Loading

0 comments on commit a88de7b

Please sign in to comment.