Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-t

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-t - npm Package Compare versions

Comparing version 1.5.1 to 1.6.0

lib/index.js

28

package.json
{
"name": "eslint-plugin-t",
"version": "1.5.1",
"main": "./src/index.js",
"version": "1.6.0",
"main": "./lib/index.js",
"files": [
"lib"
],
"scripts": {
"format": "prettier --write \"src/**/*.js\"",
"format:check": "prettier --check \"src/**/*.js\"",
"lint": "eslint --max-warnings 0 \"src/**/*.js\"",
"test": "yarn format:check && yarn lint"
"lint": "eslint --max-warnings 0 \"src/**/*.ts\"",
"typecheck": "tsc --noEmit",
"format": "prettier --write src",
"format:lib": "prettier --write lib",
"format:check": "prettier --check src",
"test": "yarn lint && yarn typecheck && yarn format:check",
"clean": "rm -rf lib",
"build": "yarn clean && rollup -c && yarn format:lib",
"prepublishOnly": "yarn build"
},
"dependencies": {},
"devDependencies": {
"@rollup/plugin-typescript": "^8.3.2",
"@types/eslint": "^8.4.2",
"eslint": "^8.17.0",
"eslint-config-xt": "^1.5.0",
"prettier": "^2.6.2",
"rollup": "^2.75.5",
"typescript": "^4.7.3"
},
"eslintConfig": {
"extends": "xt",
"rules": {
"@typescript-eslint/no-var-requires": 0
}
"extends": "xt"
},

@@ -24,0 +32,0 @@ "prettier": {

@@ -29,7 +29,7 @@ # eslint-plugin-t

Currently there's only one rule.
There's currently just one lint rule in this package.
**string-literal**
Ensures that only a string literal can be passed as the first argument to `t()`.
This rule enforces that the first argument to `t()` is a string literal. This is useful if you intend to [statically extract](https://www.i18next.com/overview/plugins-and-utils#extraction-tools) language strings because static tooling [can't evaluate expressions](https://github.com/i18next/i18next-parser#caveats).

@@ -43,3 +43,3 @@ Example:

// Incorrect usage (raises lint warning)
alert(t('Hello' + name + '!'));
alert(t('Hello ' + Math.random().toString()));
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc