New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-ts-files-only

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-ts-files-only

prevents creation of js files in specified folders

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

eslint-plugin-ts-files-only

A plugin for ESLint that allows you to prevent creation of js files in specified folders.

Dependencies

  • Requires ESLint version 8.34.0 or higher

Install

npm install eslint-plugin-ts-only-files@latest --save-dev

Usage

./.eslintrc

{
  "settings": {
    "tsFilesOnly": require('./.tsFilesOnlyConfig.json')
    // rest of your settings
  },
  "plugins": [
      "ts-files-only",
      // rest of your plugins
  ], 
  // rest of your eslintrc
}

.tsFilesOnlyConfig.json

This config file must contain an array of tsOnlyFolders and and array of perimittedFiles The folders in tsOnlyFolders will be recursively scanned any js files that are not in the perimittedFiles will be flagged as invalid.

Here's an example:

{
  "tsOnlyFolders": [
    "backend/src/server/modules",
    "backend/src/server/models",
    "backend/src/server/controllers",
    "backend/src/server/common",
    "backend/src/server/config"
  ],
  "perimittedFiles": [
    "backend/src/server/common/utils.js",
    "backend/src/server/modules/myModule.js",
    "backend/src/server/config/exampleConfig.js",
  ]
}
  

License

MIT

FAQs

Package last updated on 14 Feb 2023

Did you know?

Socket

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.

Install

Related posts

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