
Product
Introducing Socket Scanning for OpenVSX Extensions
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.
@dazn/eslint-plugin-kopytko
Advanced tools
An ESLint plugin with a set of rules
eslint peer dependency:npm i eslint --save-dev
eslint-plugin-kopytko:npm i @dazn/eslint-plugin-kopytko --save-dev
In .eslintrc:
{
"extends": "plugin:@dazn/kopytko/recommended",
"plugins": ["@dazn/kopytko"]
}
A rule to use with Kopytko Packager 's importing mechanism and Kopytko Unit Testing Framework 's mocking mechanism.
Enforces a proper alphabetical and path-specific order of @import and @mock annotations:
@mock annotations have to be after all @import annotationsExample of incorrect code:
' @import /components/main-function.brs
' @import /components/nested/another-function.brs
' @import /components/nested/cool-function.brs
' @import /components/nested/some-function.brs from package-name
' @mock /components/mocked-function.brs
' @mock /components/some-mocked-function.brs from package-name
Example of correct code:
' @import /components/nested/some-function.brs from package-name
' @mock /components/some-mocked-function.brs from package-name
' @import /components/main-function.brs
' @import /components/nested/another-function.brs
' @import /components/nested/cool-function.brs
' @mock /components/mocked-function.brs
Example of incorrect code:
' @mock /components/mocked-function.brs
' @import /components/main-function.brs
' @import /components/nested/another-function.brs
' @import /components/nested/cool-function.brs
Example of correct code:
' @import /components/main-function.brs
' @import /components/nested/another-function.brs
' @import /components/nested/cool-function.brs
' @mock /components/mocked-function.brs
Example of incorrect code:
' @import /components/a-function.brs from package-name
' @import /components/some-function.brs from another-package-name
' @mock /components/another-mocked-function.brs from package-name
' @mock /components/some-mocked-function.brs from another-package-name
' @import /components/main-function.brs
' @mock /components/mocked-function.brs
Example of correct code:
' @import /components/some-function.brs from another-package-name
' @import /components/a-function.brs from package-name
' @mock /components/some-mocked-function.brs from another-package-name
' @mock /components/another-mocked-function.brs from package-name
' @import /components/main-function.brs
' @mock /components/mocked-function.brs
Example of incorrect code:
' @import /components/nested/another-function.brs
' @import /components/main-function.brs
' @import /components/nested/cool-function.brs
' @mock /components/some-mocked-function.brs
' @mock /components/mocked-function.brs
Example of correct code:
' @import /components/main-function.brs
' @import /components/nested/another-function.brs
' @import /components/nested/cool-function.brs
' @mock /components/mocked-function.brs
' @mock /components/some-mocked-function.brs
Check if function with defined return type has return statement.
Examples of incorrect code for this rule:
function calc() as Integer
result = 1 + 2
end function
Examples of correct code for this rule:
function calc() as Integer
result = 1 + 2
return result
end function
Enforces consistent indentation of block, array and object expressions, and function declarations
Examples of incorrect code for this rule, set to 2 characters:
sub test()
example = [
1,
2,
]
if (1 = 1)
superFunction({
a: "a",
b: "b",
c: "c",
})
end if
end sub
sub another()
superFunction({})
end sub
Examples of correct code for this rule, set to 2 characters:
sub test()
example = [
1,
2,
]
if (1 = 1)
superFunction({
a: "a",
b: "b",
c: "c",
})
end if
end sub
sub another()
superFunction({})
end sub
Enforces a trailing comma after every property of multiline associative array
The --fix option on the command line can automatically fix some of the problems reported by this rule.
Examples of incorrect code for this rule:
test = {
a: "a",
b: "b"
}
Examples of correct code for this rule:
test = {
a: "a",
b: "b",
}
Check that all variables are declared.
Examples of incorrect code for this rule:
sub a()
print(foo)
end sub
Examples of correct code for this rule:
sub a()
foo = "bar"
print(foo)
end sub
Check that sub doesn't have a return type.
Examples of incorrect code for this rule:
sub a() as Dynamic
end sub
Examples of correct code for this rule:
sub a()
print("foo")
end sub
Disallows the use of print.
Disallows the use of stop.
FAQs
Set of brightscript rules for eslint
We found that @dazn/eslint-plugin-kopytko demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.

Product
Bringing supply chain security to the next generation of JavaScript package managers

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies