@transferwise/eslint-plugin
Advanced tools
Comparing version 0.2.2 to 0.3.0
@@ -0,1 +1,8 @@ | ||
# v0.3.0 | ||
## Support ESlint v9 | ||
Multiple methods on the `context` object have been removed and replaced by | ||
methods on `SourceCode`. Migrate rules to use these new methods. | ||
# v0.2.2 | ||
@@ -2,0 +9,0 @@ |
{ | ||
"name": "@transferwise/eslint-plugin", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "TransferWise ESLint plugin", | ||
@@ -27,3 +27,3 @@ "main": "./index.js", | ||
"devDependencies": { | ||
"eslint": "^8.38.0", | ||
"eslint": "^9.12.0", | ||
"jest": "^29.5.0", | ||
@@ -30,0 +30,0 @@ "release-to-github-with-changelog": "^1.2.4" |
@@ -14,6 +14,8 @@ /** | ||
RuleTester.setDefaultConfig({ | ||
parserOptions: { | ||
languageOptions: { | ||
ecmaVersion: 6, | ||
ecmaFeatures: { | ||
jsx: true, | ||
parserOptions: { | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
@@ -20,0 +22,0 @@ }, |
@@ -23,3 +23,4 @@ /** | ||
create(context) { | ||
const fileName = context.getFilename(); | ||
const sourceCode = context.sourceCode ?? context.getSourceCode(); | ||
const filename = context.filename ?? context.getFilename(); | ||
@@ -33,3 +34,3 @@ function checkExportedName(node) { | ||
const isInPagesDirectory = fileName.includes('pages'); | ||
const isInPagesDirectory = filename.includes('pages'); | ||
@@ -55,4 +56,3 @@ if (!isInPagesDirectory) { | ||
} else if (declaration.type === 'VariableDeclaration') { | ||
context | ||
.getDeclaredVariables(declaration) | ||
(sourceCode.getDeclaredVariables ? sourceCode.getDeclaredVariables(declaration, context) : context.getDeclaredVariables()) | ||
.map((v) => v.defs.find((d) => d.parent === declaration)) | ||
@@ -59,0 +59,0 @@ .map((d) => d.name) |
@@ -14,3 +14,3 @@ /** | ||
RuleTester.setDefaultConfig({ | ||
parserOptions: { | ||
languageOptions: { | ||
ecmaVersion: 2020, | ||
@@ -17,0 +17,0 @@ sourceType: 'module', |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11445
11
224