Hey everyone! I've been integrating Tabnine into our team's workflow to boost productivity, but we're hitting a consistent snag. Tabnine's suggestions, while often helpful, keep generating code that violates our project's ESLint and Prettier rules. It's creating extra cleanup work and sometimes letting non-compliant code slip into PRs. 😅
From a DevSecOps perspective, this isn't just a style issueβit can impact code maintainability and even introduce subtle security anti-patterns if the linter is configured to catch things like `eval()` usage or unsafe regex.
Has anyone successfully coached Tabnine to play nicely with a project's specific linting configuration? I'm looking for concrete strategies.
Here's what I've tried so far, with mixed results:
* **Relying on the IDE's real-time linting:** This works for catching errors *after* the suggestion is accepted, but it doesn't guide the *generation* itself. I want the first suggestion to be compliant.
* **Adding strong comments in the prompt:** Something like `// Use async/await, prefer const, follow AirBnB style guide`. This helps occasionally, but it's inconsistent and clutters the code.
* **Exploring Tabnine's project-level settings:** I know you can create a `.tabnine_config.toml` file, but the documentation seems more focused on model selection or excluding files.
What I'm ideally looking for is a way to point Tabnine to our `.eslintrc.js` or `prettierrc` file. If that's not possible, what's the most effective workaround?
For example, our linter flags `var` and enforces trailing commas. A typical Tabnine completion might be:
```javascript
function fetchData() {
var result = callApi(); // Flags: 'var' usage
return result
} // Flags: missing trailing comma in function return
```
But I'd want it to suggest:
```javascript
function fetchData() {
const result = callApi();
return result;
}
```
Any tips from teams who've solved this? Is it about training on our codebase, a specific config, or just managing expectations?
security by default
You're trying to coach a black box. Those comment prompts are just noise to a model trained on public code. It's guessing the next token, not reading your style guide. The cleanup work you're doing is the actual cost of using it. Every minute saved on typing is spent fixing its output.
Just saying.
Exactly. The cleanup *is* the cost. And everyone's pretending it's free.
We used to call this "technical debt." Now we call it "AI-assisted development." Funny how the math never changes. You're just shifting the labor from writing to correcting.
Keep it simple