Skip to content

Commit

Permalink
MI-72: Update template to use new eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
kai-nguyen-aligent committed Oct 30, 2024
1 parent 9b6f904 commit 1f49988
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 30 deletions.
3 changes: 1 addition & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import nxEslintPlugin from '@nx/eslint-plugin';
export const eslintBaseConfig = [
...eslintConfigs.core,
{
files: ['**/*.ts', '**/*.tsx'],
files: ['**/*.ts'],
plugins: {
'@nx': nxEslintPlugin,
import: eslintPluginImport,
Expand Down Expand Up @@ -38,7 +38,6 @@ export const eslintBaseConfig = [
},
{
files: ['**/*.json'],
rules: {},
languageOptions: { parser: jsonParser },
},
];
2 changes: 1 addition & 1 deletion tools/serverless-plugin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"options": {
"cwd": "{projectRoot}",
"color": true,
"command": "eslint ."
"command": "eslint . --max-warnings 0"
}
},
"test": {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { eslintBaseConfig } from '../../eslint.config.mjs';

export default [...eslintBaseConfig, { ignores: ['!./**/*.ts'] }];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { simpleObject, YOUR_ENV_VAR } from './__data__/example-data';
import { YOUR_ENV_VAR, simpleObject } from './__data__/example-data';

describe('Passing tests', () => {
test('Passing test', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"include": [
"vite.config.mjs",
"../../libs/**/src/index.ts",
"src/**/*.ts",
"**/*.test.ts"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig, mergeConfig } from 'vitest/config';
import { viteBaseConfig } from '../../vite.config.base.mjs';
import { viteBaseConfig } from '../../vite.config.mjs';

export default mergeConfig(
viteBaseConfig,
Expand Down
7 changes: 1 addition & 6 deletions tools/serverless-plugin/src/generators/service/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ export async function serviceGenerator(tree: Tree, options: serviceGeneratorSche
...buildRunCommandConfig('tsc --noEmit --pretty'),
},
lint: {
executor: '@nx/eslint:lint',
outputs: ['{options.outputFile}'],
options: {
lintFilePatterns: [projectRoot + '/**/*.ts'],
maxWarnings: 0,
},
...buildRunCommandConfig('eslint . --max-warnings 0'),
},
test: {
executor: '@nx/vite:test',
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ This service accepts events in the following format (similar to CloudWatch Event
"time": "2024-06-24T04:42:33.884Z",
"region": "ap-southeast-2",
"resources": [
"arn:aws:lambda:ap-southeast-2:XXXXXXXXXX:function:tt-int-shippit-order-dev-lambdaName"
"arn:aws:lambda:ap-southeast-2:XXXXXXXXXX:function:client-int-service-name-stg-lambdaName"
],
"detail": {
"executionArn": "arn:aws:lambda:ap-southeast-2:XXXXXXXXXX:function:tt-int-shippit-order-dev-lambdaName",
"logGroupName": "/aws/lambda/tt-int-shippit-order-dev-lambdaName",
"name": "tt-int-shippit-order-dev-lambdaName",
"executionArn": "arn:aws:lambda:ap-southeast-2:XXXXXXXXXX:function:client-int-service-name-stg-lambdaName",
"logGroupName": "/aws/lambda/client-int-service-name-stg-lambdaName",
"name": "client-int-service-name-stg-lambdaName",
"status": "FAILED",
"error": "SyntaxError",
"cause": "{\"errorType\":\"SyntaxError\",\"errorMessage\":\"Unexpected token u in JSON at position 0\",\"trace\":\"SyntaxError: Unexpected token u in JSON at position 0\\n at JSON.parse (<anonymous>)\\n at Runtime.V1 (/src/lambda/create-shippit-order.ts:39:34)\\n at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1173:29)\"}"
"cause": "{\"errorType\":\"SyntaxError\",\"errorMessage\":\"Unexpected token u in JSON at position 0\",\"trace\":\"SyntaxError: Unexpected token u in JSON at position 0\\n at JSON.parse (<anonymous>)\\n at Runtime.V1 (/src/lambda/create-order.ts:39:34)\\n at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1173:29)\"}"
}
}
```
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { eslintBaseConfig } from '../../eslint.config.mjs';

export default [...eslintBaseConfig, { ignores: ['!./**/*.ts'] }];
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "../../tsconfig.base.json",
"include": [
"vite.config.mjs",
"../../libs/**/src/index.ts",
"src/**/*.ts",
"**/*.test.ts"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig, mergeConfig } from 'vitest/config';
import { viteBaseConfig } from '../../vite.config.base.mjs';
import { viteBaseConfig } from '../../vite.config.mjs';

export default mergeConfig(
viteBaseConfig,
Expand Down
4 changes: 1 addition & 3 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"exactOptionalPropertyTypes": false,
"noUncheckedSideEffectImports": true,
"paths": {
"@aligent/serverless-plugin": [
"tools/serverless-plugin/src/index.ts"
]
"@aligent/serverless-plugin": ["tools/serverless-plugin/src/index.ts"]
},
"types": ["node", "vitest", "vitest/globals"]
}
Expand Down

0 comments on commit 1f49988

Please sign in to comment.