Skip to content

Commit

Permalink
restructure folders
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-zhang-at-salesforce committed May 9, 2024
1 parent 7d4ff48 commit 421d134
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 12 deletions.
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/stylistic"
],
"env": {
"jest": true,
"node": true
},
"rules": {
"strict": ["error", "global"]
},
"ignorePatterns": ["test/**/test.js"]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"eslint.lintTask.enable": true,
"eslint.validate": ["javascript", "typescript"]
}
1 change: 1 addition & 0 deletions examples/dummy/fooBar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const foo = 'baz';
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default {
testPathIgnorePatterns: ['/node_modules/', '<rootDir>/lib/'],
moduleDirectories: ['node_modules'],
collectCoverage: true,
collectCoverageFrom: ['lib/**/*.ts'],
collectCoverageFrom: ['src/**/*.ts'],
coverageDirectory: 'reports/coverage',
reporters: [
'default',
Expand Down
21 changes: 17 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
],
"devDependencies": {
"@eslint/js": "^9.2.0",
"@graphql-eslint/eslint-plugin": "^3.20.1",
"@jest/globals": "^29.7.0",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
Expand All @@ -81,8 +82,7 @@
"prettier": "^3.0.2",
"ts-jest": "^29.1.2",
"typescript": "^5.4.5",
"typescript-eslint": "^7.8.0",
"@graphql-eslint/eslint-plugin": "^3.20.1"
"typescript-eslint": "^7.8.0"
},
"peerDependencies": {
"eslint": ">=7"
Expand Down
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@

import base from './configs/base.js';
import recommended from './configs/recommended.js';
import enforceFooBar from './rules/enforce-foo-bar.js';
import enforceFooBar from './rules/dummy/enforce-foo-bar.js';
import { rule as noMoreThan2Fields } from './rules/graphql/no-more-than-2-fields.js';
export default {
rules: {
'enforce-foo-bar': enforceFooBar
'enforce-foo-bar': enforceFooBar,
'no-more-than-2-fields': noMoreThan2Fields
},
config: {
base,
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Kind, NameNode } from 'graphql';
import { GraphQLESLintRule, GraphQLESLintRuleContext } from '@graphql-eslint/eslint-plugin/';

const RULE_ID: string = 'no-more-than-2-fields';
const RULE_ID = 'no-more-than-2-fields';

export const rule: GraphQLESLintRule = {
meta: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { RuleTester } from '@typescript-eslint/rule-tester';

import ruleEnforceFoorBar from '../../src/rules/enforce-foo-bar';
import ruleEnforceFoorBar from '../../../src/rules/dummy/enforce-foo-bar';

const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
import { rule } from '../../src/rules/no-more-than-2-fields';
import { rule } from '../../../src/rules/graphql/no-more-than-2-fields';

const ruleTester = new RuleTester({
parser: '@graphql-eslint/eslint-plugin',
Expand Down

0 comments on commit 421d134

Please sign in to comment.