tessl install tessl/npm-eslint-config-node@3.0.0Pluggable ESLint configuration for Node.js that extends ESNext with Node.js-specific safety checks and best practices
Agent Success
Agent success rate when using this tile
73%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.12x
Baseline
Agent success rate without this tile
65%
Configure ESLint to validate import statement file extensions according to project-specific rules.
You need to configure ESLint with rules that enforce consistent usage of file extensions in import statements. Some projects require explicit extensions, while others omit them - your configuration should enforce the chosen convention.
Create an ESLint configuration file (.eslintrc.json) that:
.js extensions for all relative imports.json extensions for JSON file importsThe configuration must validate:
import foo from './bar'const foo = require('./bar')./ and ../) and package importsCreate a test file (test.js) that demonstrates:
.js extension: import helper from './helper.js'import lodash from 'lodash'.js extension (should be caught by linting)The following test cases verify the configuration works correctly:
import './module' (missing .js) reports an error @testimport './module.js' reports no errors @testimport 'lodash' (package import) reports no errors @testrequire('./config') (missing .json for JSON file) reports an error @test@generates
{
"extends": ["..."],
"rules": {
"import/extensions": ["error", "always", {
"ignorePackages": true
}]
}
}Provides the import/extensions rule for validating import statement file extensions
@satisfied-by