Git Product home page Git Product logo

Comments (9)

jasdf2351 avatar jasdf2351 commented on September 7, 2024

Just seen update, updated to tslint 4.0.1 and tslint-loader 3.0.0, same issue :)
FYI: tslint works as expected if I run from command line: tslint ./server/**/*.ts

from tslint-loader.

jmlopez-rod avatar jmlopez-rod commented on September 7, 2024

@jasdf2351 Does it work if you remove the tslint-loader option?

module.exports = {
  entry: {
    server: './bin/www.ts'
  },
  output: {
    filename: '[name].js',
    path: './build',
    libraryTarget: "commonjs"
  },
  devtool: 'source-map',
  target: 'node',
  externals: [
    /^[a-z-0-9]+$/ // Ignore node_modules folder
  ],
  resolve: {
    // Add in .ts as a resolvable extension.
    extensions: ['.ts'],
  },
  resolveLoader: {
    modules: ['./node_modules']
  },
  module: {
    /* rules: [{
      enforce: 'pre',
      test: /.ts$/,
      loader: 'tslint-loader',
      exclude: /(node_modules)/
    }], */
    loaders: [{
      test: /.ts$/,
      exclude: [/node_modules/],
      loader: 'awesome-typescript-loader'
    }]
  },
  plugins
};

Just to make sure this is a problem with the tslint-loader and not with the typescript loader.
I'm not using webpack 2 yet, but in my configuration I have it like this:

{ test: /\.ts$/i, loaders: ['ts', 'tslint'], exclude: /node_modules/ },

You would have to use awesome-typescript instead of ts in your case.

from tslint-loader.

jasdf2351 avatar jasdf2351 commented on September 7, 2024

@jmlopez-rod Thanks for the tip, got it sorted. The docs have changed slightly since I last read them for the beta, now have:

module.exports = {
entry: {
server: './bin/www.ts'
},
output: {
filename: '[name].js',
path: './build',
libraryTarget: "commonjs"
},
devtool: 'source-map',
target: 'node',
externals: [
/^[a-z-0-9]+$/ // Ignore node_modules folder
],
resolve: {
// Add in .ts as a resolvable extension.
extensions: ['.ts'],
modules: ['./node_modules']
},
module: {
rules: [{
enforce: 'pre',
test: /.ts$/,
loader: 'tslint-loader',
exclude: /(node_modules)/
}, {
test: /.ts$/,
loader: 'awesome-typescript-loader',
exclude: /(node_modules)/
}]
},
plugins
};

and turned on "no-any": true and it correctly spat out errors, turned it off and it's now passing.

Still does a build despite failOnHint: true being set, might just have to wait that one out do you think?

from tslint-loader.

jmlopez-rod avatar jmlopez-rod commented on September 7, 2024

So just to be clear, the no-any option is from typescript right? It doesn't look like the issue is due to tslint at all then, seems more like an awesome-typescript-loader issue. Try removing the tslint-loader for moment and add several options to typescript, for instance:

noUnusedParameters 
noUnusedLocals

Then declare some variable and see if your build fails.

from tslint-loader.

sonicoder86 avatar sonicoder86 commented on September 7, 2024

@jasdf2351 Is the tslint-loader related part resolved then?

from tslint-loader.

jmlopez-rod avatar jmlopez-rod commented on September 7, 2024

@BlackSonic That's what it seems. I think it is safe to close issue unless @jasdf2351 has additional info. Also @jasdf2351 try to format what you post so that it easier for others to read, see https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code-and-syntax-highlighting.

from tslint-loader.

jasdf2351 avatar jasdf2351 commented on September 7, 2024

@jmlopez-rod no-any: true is a rule from within tslint.json, tslint-loader correctly flags this as it should, a warning, however then webpack continues and does the build, I thought that failOnHint: true would stop webpack from continuing to do the build.

Maybe it's a webpack-beta thing and might settle down when you guys have a stable webpack to test against?

Apologies for my lack of Markdown-foo, I've found the preview button :)

from tslint-loader.

sonicoder86 avatar sonicoder86 commented on September 7, 2024

No tests currently for Webpack beta, only for the stable branch.

from tslint-loader.

jasdf2351 avatar jasdf2351 commented on September 7, 2024

@BlackSonic I saw the test for failOnHint hence why I asked, thought I'd double check. Thanks for info, closing and will keep an eye out for WP2 hitting, keep up the great work.

from tslint-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.