Skip to content

Commit 3ca1bcd

Browse files
Added prettier and eslint
Co-authored-by: SrinivasanTarget <[email protected]>
1 parent cf38fd0 commit 3ca1bcd

18 files changed

+2091
-259
lines changed

.prettierignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Dependencies
2+
node_modules/
3+
4+
# Build output
5+
dist/
6+
7+
# Logs
8+
*.log
9+
10+
# Package files
11+
package-lock.json
12+
yarn.lock
13+
14+
# Git
15+
.git/
16+
17+
# IDE
18+
.vscode/
19+
.idea/
20+
21+
# OS
22+
.DS_Store
23+
Thumbs.db
24+
25+
# Generated files
26+
*.d.ts

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 80,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"bracketSpacing": true,
9+
"arrowParens": "avoid"
10+
}

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Mobile Agent
2+
3+
MCP server providing resources and tools for Appium mobile gestures.
4+
5+
## Development
6+
7+
### Code Quality
8+
9+
This project uses ESLint for linting and Prettier for code formatting.
10+
11+
#### Available Scripts
12+
13+
- `npm run lint` - Run ESLint to check for code issues
14+
- `npm run lint:fix` - Run ESLint and automatically fix issues where possible
15+
- `npm run format` - Format all code using Prettier
16+
- `npm run format:check` - Check if code is properly formatted
17+
- `npm run check` - Run both linting and format checking
18+
19+
#### Configuration
20+
21+
- **ESLint**: Configured in `eslint.config.js` with TypeScript support
22+
- **Prettier**: Configured in `.prettierrc` with project-specific formatting rules
23+
- **Prettier Ignore**: Files to exclude from formatting are listed in `.prettierignore`
24+
25+
#### Pre-commit Workflow
26+
27+
Before committing code, run:
28+
29+
```bash
30+
npm run check
31+
```
32+
33+
This will ensure your code passes both linting and formatting checks.
34+
35+
## Build and Run
36+
37+
- `npm run build` - Build the project
38+
- `npm start` - Start the server
39+
- `npm run dev` - Run in development mode

eslint.config.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import js from '@eslint/js';
2+
import typescript from '@typescript-eslint/eslint-plugin';
3+
import typescriptParser from '@typescript-eslint/parser';
4+
import prettier from 'eslint-plugin-prettier';
5+
import prettierConfig from 'eslint-config-prettier';
6+
7+
export default [
8+
js.configs.recommended,
9+
{
10+
files: ['src/**/*.ts'],
11+
languageOptions: {
12+
parser: typescriptParser,
13+
parserOptions: {
14+
ecmaVersion: 'latest',
15+
sourceType: 'module',
16+
},
17+
globals: {
18+
console: 'readonly',
19+
process: 'readonly',
20+
Buffer: 'readonly',
21+
__dirname: 'readonly',
22+
__filename: 'readonly',
23+
global: 'readonly',
24+
module: 'readonly',
25+
require: 'readonly',
26+
exports: 'readonly',
27+
},
28+
},
29+
plugins: {
30+
'@typescript-eslint': typescript,
31+
prettier: prettier,
32+
},
33+
rules: {
34+
...typescript.configs.recommended.rules,
35+
...prettierConfig.rules,
36+
'prettier/prettier': 'error',
37+
'@typescript-eslint/no-unused-vars': 'off',
38+
'@typescript-eslint/explicit-function-return-type': 'off',
39+
'@typescript-eslint/explicit-module-boundary-types': 'off',
40+
'@typescript-eslint/no-explicit-any': 'off',
41+
'@typescript-eslint/ban-ts-comment': 'off',
42+
'no-undef': 'off', // TypeScript handles this
43+
'no-case-declarations': 'off',
44+
},
45+
},
46+
{
47+
ignores: ['dist/', 'node_modules/', '*.js'],
48+
},
49+
];

0 commit comments

Comments
 (0)